Hali
Unatkoztam, és meguntam, hogy menübõl kell megnéznem a MAPot, ezért írtam egy kis \'scriptet\' ennek lerövidítésére
Kép[hs width=300 height=300]
http://i46.tinypic.com/vpz12w.jpg[/hs]
LényegeIgazából egyszerûsítés, a GTA térképét TextDrawban, illetve a szerveren található játékosokat színes (
játékos színe) pontokban jeleníti meg,
nagyjából pontosan.
Használata - Nyomd meg az \'N\' billentyût
Config - MAX_PLAYERS - ide írd, hány slotos a szervered.
- SUPPORT_NPC - true, vagy false, NPCk megjelenítése a MAPon.
Support Kód #include <a_samp>
#undef MAX_PLAYERS
#define MAX_PLAYERS 50
#define MAX_MAP_PLAYERS MAX_PLAYERS
#define SUPPORT_NPC true
new Text:gMap,
PlayerText:pLocation[MAX_MAP_PLAYERS],
bool:pToggle[MAX_PLAYERS] = false;
new PlayerColors[] = {
0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,0xF4A460FF,
0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,
0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,
0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,0x3D0A4FFF,
0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,0x057F94FF,
0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,
0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,
0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,
0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,
0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,0xDCDE3DFF,
0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF,
0xD8C762FF,0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,
0xF4A460FF,0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,
0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,
0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,
0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,
0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,
0x18F71FFF,0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,
0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,
0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,
0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,
0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,
0xD8C762FF,0xD8C762FF
};
public OnFilterScriptInit() {
gMap = TextDrawCreate(147.000000, 79.000000, \"samaps:map\");
TextDrawBackgroundColor(gMap, 255);
TextDrawFont(gMap, 4);
TextDrawLetterSize(gMap, 0.500000, 1.000000);
TextDrawColor(gMap, -1);
TextDrawSetOutline(gMap, 0);
TextDrawSetProportional(gMap, 1);
TextDrawSetShadow(gMap, 1);
TextDrawUseBox(gMap, 1);
TextDrawBoxColor(gMap, 255);
TextDrawTextSize(gMap, 350.000000, 350.000000);
return 1;
}
public OnFilterScriptExit() {
TextDrawDestroy(gMap);
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
for(new i = 0; i < MAX_MAP_PLAYERS; i++)
PlayerTextDrawDestroy(playerid, pLocation);
return 1;
}
public OnPlayerConnect(playerid) {
SetPlayerColor(playerid, PlayerColors[random(sizeof(PlayerColors))]);
return 1;
}
public OnPlayerDisconnect(playerid, reason) {
TextDrawHideForPlayer(playerid, gMap);
for(new i = 0; i < MAX_MAP_PLAYERS; i++) PlayerTextDrawHide(playerid, pLocation);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
if((newkeys & KEY_NO) && !(oldkeys & KEY_NO)) {
if(!pToggle[playerid]) {
new Float:X,
Float:Y,
Float:Z;
pToggle[playerid] = true;
TextDrawShowForPlayer(playerid, gMap);
for(new i = 0; i < MAX_MAP_PLAYERS; i++) {
if(!IsPlayerConnected(i)) continue;
#if SUPPORT_NPC == false
if(IsPlayerNPC(i)) continue;
#endif
if(!IsPlayerInAnyVehicle(i)) GetPlayerPos(i, X, Y, Z);
else GetVehiclePos(GetPlayerVehicleID(i), X, Y, Z);
X = 320.0 + (X * 0.0583);
Y = (252.0 - (Y * 0.0583)) - 2.5;
pLocation = CreatePlayerTextDraw(playerid, X, Y, \".\");
PlayerTextDrawBackgroundColor(playerid, pLocation, 255);
PlayerTextDrawFont(playerid, pLocation, 1);
PlayerTextDrawLetterSize(playerid, pLocation, 0.500000, 1.000000);
PlayerTextDrawColor(playerid, pLocation, GetPlayerColor(i));
PlayerTextDrawSetOutline(playerid, pLocation, 1);
PlayerTextDrawSetProportional(playerid, pLocation, 1);
PlayerTextDrawShow(playerid, pLocation);
}
for(new i = 0; i < 4; i++) SendClientMessage(playerid, -1, \" \");
} else if(pToggle[playerid]) {
pToggle[playerid] = false;
TextDrawHideForPlayer(playerid, gMap);
for(new i = 0; i < MAX_MAP_PLAYERS; i++) PlayerTextDrawDestroy(playerid, pLocation);
}
}
return 1;
}
Lusta vagyok feltölteni pastebinre. >.>További fejlesztését nem igen tervezem..