snaptrap
Active member
- Joined
- Feb 7, 2014
- Messages
- 56
- Reaction score
- 1
when i try to /player that is not connected,it just teleport me to a farm(i think default coordinate)..when i /goto myself,i just teleport to my own coordinate and not give me any error message that i include in the script..and one more thing,it doesn't send any message to player or player that we want to teleport when i /goto player that is available...please see my code below
everything is not work except when i /goto player that is connected and available..it work fine but it doesn't send any message.
please help me :bawww:
everything is not work except when i /goto player that is connected and available..it work fine but it doesn't send any message.
Code:
CMD:goto(playerid, params[])
{
new id, name[256], pname[256], string[256], pstring[256];
if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[USAGE] /goto <id>");//checks if you have written something after /goto if no it sends error
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[ERROR]The Player Is Not Connected");
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[ERROR]You Can't Teleport To Your Self");
if(togglegoto[playerid] == 1) return SendClientMessage(playerid, 0xFF0000FF, "v{FFFFFF}[SYSTEM]{00CCFF}Your ToggleGoto Is OFF.You Can't GoTo To Other Player");
if(togglegoto[id] == 1) return SendClientMessage(id, 0xFF0000FF, "v{FFFFFF}[SYSTEM] The Player Is Current Not Available.");
GetPlayerName( playerid, name, sizeof(name));
GetPlayerName( id, pname, sizeof(pname));
format(string, sizeof(string), "{FFFFFF}[SYSTEM] {00CCFF}Teleported To %s(%i)", pname, id);
format(string, sizeof(pstring), "{FFFFFF}[SYSTEM]{00CCFF}%s(%i) Has Teleport To You", name, playerid);
SendClientMessage(id, 0x0, pstring);
SendClientMessage(playerid, 0x0, string);
new float:X, float:Y, float:Z;
GetPlayerPos(id, X, Y, Z);
SetPlayerPos(playerid, X+1, Y+1, Z);
return 1;
}
please help me :bawww: