22.04.2009, 10:01
I just made that when an Admin types /track <id> the player`s name that he is tracking turns to red, but I want to make that on the Mini Map an Icon gets placed, which moves with the player, help?
Originally Posted by nickbugun
that doesnt move with the player
|
if(strcmp("/track",cmdtext, true, 10) == 0) { if(PlayerInfo[playerid][pAdmin] < 5) return DenyMessage(playerid, 7); tmp = strtok(cmdtext, idx); new trackedplayer = ReturnUser(tmp); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /track [playerid]"); if(!IsPlayerConnected(trackedplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID."); SetTimer("Trackertimer", 1000, 0); SetPlayerMarkerForPlayer(playerid, trackedplayer, COLOR_DARKRED); new name2[MAX_PLAYER_NAME]; GetPlayerName(trackedplayer, name2, sizeof(trackedplayer)); format(string, 256, "Tracking %s : %d",trackedplayer, GetPlayerState(trackedplayer)); SendClientMessage(playerid,COLOR_RED,string); return 1; }
public TrackerTimer(playerid, trackedplayer) { new trackedplayer; SetPlayerCheckpoint(playerid, trackedplayer); }
Originally Posted by nickbugun
I can`t do it.. I made /track <playerid>, and it tracks that player (tracked player) and cant make the timer:
Код:
if(strcmp("/track",cmdtext, true, 10) == 0) { if(PlayerInfo[playerid][pAdmin] < 5) return DenyMessage(playerid, 7); tmp = strtok(cmdtext, idx); new trackedplayer = ReturnUser(tmp); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /track [playerid]"); if(!IsPlayerConnected(trackedplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID."); SetTimer("Trackertimer", 1000, 0); SetPlayerMarkerForPlayer(playerid, trackedplayer, COLOR_DARKRED); new name2[MAX_PLAYER_NAME]; GetPlayerName(trackedplayer, name2, sizeof(trackedplayer)); format(string, 256, "Tracking %s : %d",trackedplayer, GetPlayerState(trackedplayer)); SendClientMessage(playerid,COLOR_RED,string); return 1; } Код:
public TrackerTimer(playerid, trackedplayer) { new trackedplayer; SetPlayerCheckpoint(playerid, trackedplayer); } (5930) : warning 219: local variable "trackedplayer" shadows a variable at a preceding level (5931) : warning 202: number of arguments does not match definition (5931) : warning 202: number of arguments does not match definition (5931) : warning 202: number of arguments does not match definition |