25.05.2014, 06:43
How do when someone teleports me to defend me in chat.
Exemple: Admins has teleport to you.
Exemple: Admins has teleport to you.
CMD:go(playerid,params[])
{
new ID;
if(sscanf(params, "u", ID)) return GameTextForPlayer(playerid,"~g~Usage: ~n~~w~/Go <ID>",2000,3);
else if(!IsPlayerConnected(ID) || ID == playerid) return GameTextForPlayer(playerid,"~g~Error: ~n~~w~Player Is not connected",2000,3);
else
{
new Float:x, Float:y, Float:z;
new name[MAX_PLAYER_NAME+1],name2[MAX_PLAYER_NAME+1], string[40+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(ID, name2, sizeof(name2));
GetPlayerPos(ID, x, y, z);
SetPlayerPos(playerid, x+1, y+1, z+1);
format(string,sizeof(string),"{99FF00}>> %s(%d) has teleported to you. (/go)",name, playerid);
SendClientMessage(ID,0xFFFFFFc8,string);
format(string,sizeof(string),"{99FF00}>> You have teleported to %s. (/go)",name2, ID);
SendClientMessage(playerid,0xFFFFFFc8,string);
}
return 1;
}
new Float:x, Float:y, Float:z;
46283 new name[MAX_PLAYER_NAME+1],name2[MAX_PLAYER_NAME+1], string[40+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(playerid, name2, sizeof(name2));
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x+1, y+1, z+1);
format(string,sizeof(string),"{99FF00}>> %s(%d) has teleported to you. (/goto)",name, playerid);
SendClientMessage(playerid,0xFFFFFFc8,string);
format(string,sizeof(string),"{99FF00}>> You have teleported to %s. (/goto)",name2, playerid);
SendClientMessage(playerid,0xFFFFFFc8,string);
}
return 1;
}
C:\Documents and Settings\Madalin\Desktop\GM\gamemodes\Godfather.pwn(46283) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Header size: 11920 bytes
Code size: 2658036 bytes
Data size: 7236240 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 9922580 bytes
1 Warning.
CMD:go(playerid,params[])
{
new ID;
if(sscanf(params, "u", ID)) return GameTextForPlayer(playerid,"~g~Usage: ~n~~w~/Go <ID>",2000,3);
else if(!IsPlayerConnected(ID) || ID == playerid) return GameTextForPlayer(playerid,"~g~Error: ~n~~w~Player Is not connected",2000,3);
else
{
new Float:x, Float:y, Float:z,stringg[40+MAX_PLAYER_NAME+1];
GetPlayerPos(ID, x, y, z);
SetPlayerPos(playerid, x+1, y+1, z+1);
format(stringg,sizeof(stringg),"{99FF00}>> %s(%d) has teleported to you. (/go)",GetName(playerid));
SendClientMessage(ID,0xFFFFFFc8,stringg);
format(stringg,sizeof(stringg),"{99FF00}>> You have teleported to %s. (/go)",GetName(ID));
SendClientMessage(playerid,0xFFFFFFc8,stringg);
}
return 1;
}
stock GetName(playerid);
{
new szName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szName, sizeof(szName));
return szName;
}