Jump to content
  • 0

Problema goto


d@rK

Question

La /goto as vrea sa apara adminilor cand un player sa teleporteaza la cineva, am incercat cu ABroadCast dar nu cred ca am facut bine, imi da erori... :(

PAWNO:

[pawn]if(strcmp(cmd, "/goto", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /goto [playerid/PartOfName]");

return 1;

}

new Float:plocx,Float:plocy,Float:plocz;

new plo;

plo = ReturnUser(tmp);

if (IsPlayerConnected(plo))

{

    if(plo != INVALID_PLAYER_ID)

    {

if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pAgent] >= 1)

{

if(Spectate[playerid] != 255)

{

Spectate[playerid] = 256;

}

GetPlayerPos(plo, plocx, plocy, plocz);

if(PlayerInfo[plo][pInt] > 0)

{

SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);

PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];

PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];

}

if(PlayerInfo[playerid][pInt] == 0)

{

SetPlayerInterior(playerid,0);

}

if(plocz > 530.0 && PlayerInfo[plo][pInt] == 0) //the highest land point in sa = 526.8

{

SetPlayerInterior(playerid,1);

PlayerInfo[playerid][pInt] = 1;

}

if (GetPlayerState(playerid) == 2)

{

new tmpcar = GetPlayerVehicleID(playerid);

SetVehiclePos(tmpcar, plocx, plocy+4, plocz);

TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;

}

else

{

SetPlayerPos(playerid,plocx,plocy+2, plocz);

}

SendClientMessage(playerid, 0xA8A8FFFF, "Ai fost teleportat cu Succes!");

                                                ABroadCast(COLOR_RED, string, 1), "%s s-a teleportat la %s");

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "Nu ai acces la aceasta comanda!");

}

}

}

else

{

format(string, sizeof(string), "%d nu este pe server.", plo);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Incearca asa

In loc de

[pawn]ABroadCast(COLOR_RED, string, 1), "%s s-a teleportat la %s");[/pawn]

Pui tot codul de mai jos

[pawn]

new name [ 24 ] , name2 [ 24 ] , t_str[ 100 ] ;

GetPlayerName ( playerid , name , 24 ) ;

GetPlayerName ( plo , name2 , 24 ) ;

format (  t_str , 100 , "%s s-a teleportat la %s" , name , name2 ) ;

ABroadCast ( COLOR_RED , t_str , 1 ) ;

[/pawn]

Massari e curva mea

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.