03.02.2009, 23:53
im am now currently adding some tele cmds for my admins script, but i am having some trobble..
i am wondering iof this code will work to tele to another player:
and just switching some things arround to tele them to me:
that pretty much it! look over it and tell me if it looks right!
i am wondering iof this code will work to tele to another player:
Код:
if((strcmp(cmdtext, "/teleto", true, 5)== 0))
{
if(!strlen(cmdtext[6]))
{
SendClientMessage(playerid, 0xFF0000AA, "Use: /teleto [playerid]");
return 1;
}
new toid = strval(cmdtext[6]);
new pName[24], str[64];
if(IsPlayerConnected(toid))
{
GetPlayerName(toid, pName, 24);
SendClientMessage(playerid, 0xFF0000AA, "Teleported");
new Float:X,Float:Y,Float:Z;
GetPlayerPos(toid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z);
}
return 1;
}
Код:
if((strcmp(cmdtext, "/teleto", true, 5)== 0))
{
if(!strlen(cmdtext[6]))
{
SendClientMessage(playerid, 0xFF0000AA, "Use: /teletome [playerid]");
return 1;
}
new fromid = strval(cmdtext[6]);
new pName[24], str[64];
if(IsPlayerConnected(fromid))
{
GetPlayerName(fromid, pName, 24);
SendClientMessage(playerid, 0xFF0000AA, "Teleported");
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(fromid,X,Y,Z);
}
return 1;
}

