14.11.2011, 20:16
Alguйm pode adaptar esse cуdigo pra player ?
Thx .
Thx .
pawn Код:
if(strcmp(cmd, "/goto", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), "level");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DBLUE, "Uso correto: /goto [id do player]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
giveplayerid = strval(tmp);
if(logged[playerid] == 1)
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
if(IsPlayerConnected(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Vocк se teleportou para %s(%i).", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_BLUE, string);
GetPlayerPos(giveplayerid, plocx, plocy, plocz);
new intid = GetPlayerInterior(giveplayerid);
SetPlayerInterior(playerid,intid);
new PlayerName[30];
GetPlayerName(playerid, PlayerName, 30);
printf("[Command] %s usou /goto para se teleportar para %s.", PlayerName, giveplayer);
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
}
else
{
format(string, sizeof(string), "%d nгo й um player ativo!", giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Vocк nгo permissгo para usar este comando!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Vocк tem que estar logado para usar este comando!");
}
return 1;
}