)dcmd_goto(playerid,params[])
{
new playerid2;
new tmp[128], Index, string[128];
tmp = strtok(params,Index), playerid2 = strval(tmp);
if(!strlen(params)) return SendClientMessage(playerid,red,"USAGE: /goto [ID]");
if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,red,"ERROR: Player is not connected!");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid2, x, y, z);
SetPlayerPos(playerid, x+2, y, z);
format(string,sizeof(string),"You have teleported to %s's location!",GetName(playerid2));
SendClientMessage(playerid,blue,string);
format(string,sizeof(string),"Player %s has teleported to you!",GetName(playerid));
SendClientMessage(playerid,blue,string);
return 1;
}
dcmd_goto(playerid,params[])
{
new playerid2, string[128];
if(!sscanf(params, "u", playerid2))
{
if(IsPlayerConnected(playerid2))
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid2, x, y, z);
SetPlayerPos(playerid, x+2, y, z);
format(string,sizeof(string),"You have teleported to %s's location!",GetName(playerid2));
SendClientMessage(playerid,blue,string);
format(string,sizeof(string),"Player %s has teleported to you!",GetName(playerid));
SendClientMessage(playerid,blue,string);
}
else return SendClientMessage(playerid,red,"ERROR: Player is not connected!");
}
else return SendClientMessage(playerid,red,"USAGE: /goto [ID]");
return 1;
}
if(!sscanf(params, "u", playerid2))
|
Lol, it works now, I didn't do anything o.O
Anyway, thx! Beer for you ![]() |
Glad I could help ya'
undefined symbol "GetName" undefined symbol "GetName"
stock GetName(playerid)
{
new pName[MAX_PLAYER_NAME];
if( IsPlayerConnected(playerid))
{
GetPlayerName(playerid, pName, sizeof(pName));
}
return pName;
}