18.01.2010, 14:24
I want to get it,
So if im on my server and my id is 0, And i say /goto 0, It says i cant, Because im trying to goto myself,
So how do i make it, So it checks if im trying to goto myself and dosent let me with a message telling me?
heres the code im using so far:
So if im on my server and my id is 0, And i say /goto 0, It says i cant, Because im trying to goto myself,
So how do i make it, So it checks if im trying to goto myself and dosent let me with a message telling me?
heres the code im using so far:
pawn Код:
dcmd_goto(playerid, params[])
{
if (strlen(params))
{
id = strval(params);
if (IsPlayerConnected(id))
{
if(Administrator[playerid] >= 1)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(id, x, y, z);
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Administrator %s has teleported to your location.", name);
SendClientMessage(id, COLOR_WHITE, string);
SetPlayerPos(playerid, x, y, z);
GetPlayerName(id, name, sizeof(name));
format(string, sizeof(string), "You have teleported to %s location", name);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not a Administrator");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Player not Found");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Usage: /goto [Playerid/PartOfName]");
}
return 1;
}