15.04.2009, 19:31
I`m trying to make that when a player types /gps <other player`s id> on the player who wrote that command, he can see a marker that shows where the other player is. And after 1 real life minute the tracking stops.
Originally Posted by nickbugun
can you give me the code for /gps and the playercheckpoint?
|
#include <a_samp> forward timer(); #if defined FILTERSCRIPT #define FILTERSCRIPT public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256], tmp[256], string[256], idx, giveplayerid; if(strcmp(cmd, "/gps", true) == 0) { new Float:x, Float:y, Float:z; GetPlayerPos(giveplayerid, x, y, z); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid,0xFFFF00AA,"Usage: /gps [playerid]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); format(string, sizeof(string), "%s %s launched in the wake of GPS to find you!'", Name); SendClientMessage(giveplayerid, 0xFFFF00AA, string); SendClientMessage(playerid, 0xFFFF00AA, "Coords : %f,%f,%f, Checkpoint created!Go to player!"); SetTimer("message",1000,false); SetPlayerCheckpoint(playerid, x, y, z); } else SendClientMessage(playerid, 0xFFFF00AA, "Player is not connected."); return 1; } return 0; } public timer() { new giveplayerid; new Float:x, Float:y, Float:z; GetPlayerPos(giveplayerid, x, y, z); SetPlayerCheckpoint(playerid, x, y, z); return 1; } #endif
Originally Posted by The Modder
Hi.
Код:
if(strcmp(cmd, "/gps", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid,SZURKE,"Hasznбlat: /katona [playerid]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { Info[playerid][lmunka] = 12; GivePlayerWeapon(giveplayerid, 24, 500); GivePlayerWeapon(giveplayerid, 31, 700); GivePlayerWeapon(giveplayerid, 3, 500); new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof (name)); format(string, sizeof(string), "%s, a tбbornok Kцzlegйnnyй nevezett ki.Mostantуl a seregnйl szolgбlsz.", name); SendClientMessage(giveplayerid, CITROM, string); GetPlayerName(giveplayerid, giveplayer, sizeof (giveplayer)); format(string, sizeof(string), "Kinevezted %s-t kцzlegйnnyй!", giveplayer); SendClientMessage(playerid, CITROM, string); SetPlayerSkin(giveplayerid, 285); } else SendClientMessage(playerid, SZURKE, "Jбtйkos nem elйrhető."); } else SendClientMessage(playerid, SZURKE, "Nem vagy leader."); return 1; } |
new
cmd[128];
cmd=strtok(cmdtext,idx);
if(!strcmp(cmd,"/gps",true))
{
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,color,"/gps [playerid/name]");
new id=ReturnUser(cmd);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,color,"That player not connected.");
SetPlayerMarkerForPlayer(playerid,id,color);
return 1;
}