05.05.2015, 13:44
I need your help. I want to add if is player in vehicle to port him and vehicle to the player who executed the command.
Here's the code. So if you could reply i would appreciate.
Here's the code. So if you could reply i would appreciate.

PHP код:
CMD:gethere(playerid,params[])
{
new ID,Float:x,Float:y,Float:z,ime[MAX_PLAYER_NAME],ime2[MAX_PLAYER_NAME],poruka[128],poruka2[128],poruka3[128];
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Niste ulogirani na server");
if(PlayerInfo[playerid][pAdministrator] < 1 && PlayerInfo[playerid][pSupporter] < 1) return SendClientMessage(playerid,-1,"{F81414}Greska:{FFFFFF} Nemate dozvolu za tu komandu");
else if(sscanf(params,"u",ID)) return SendClientMessage(playerid,-1,"{FFFFFF}Koristenje:{FFF1AF} /gethere (ID/Ime)");
else if(PlayerInfo[playerid][pAdministrator] <= 1) return SendClientMessage(playerid, -1,"{F81414}Greska:{FFFFFF} Nemate dozvolu za tu komandu");
else if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"{F81414}Greska:{FFFFFF} Igrač nije ulogiran na serveru.");
else if(ID == playerid) return SendClientMessage(playerid,-1,"{F81414}Greska:{FFFFFF} Nemozete teleportirati sami sebe");
else
{
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(ID,x+1,y+1,z);
GetPlayerName(ID,ime,sizeof(ime));
format(poruka,sizeof(poruka),"{00C0FF}WG:{FFFFFF} Teleportirali ste {FFF1AF}%s(%d){FFFFFF} do sebe.)",ime,ID);
SendClientMessage(playerid,-1,poruka);
GetPlayerName(playerid,ime2,sizeof(ime2));
format(poruka2,sizeof(poruka2),"{00C0FF}WG:{FFF1AF} %s{FFFFFF} vas je teleportirao do sebe.",ime2);
SendClientMessage(ID,-1,poruka2);
format(poruka3,sizeof(poruka3),""COLOR_SIVA"[Admin-Announce]:{FFFFFF} %s je teleportirao %s do sebe.",ime2,ime);
SendAdminMessage(-1,poruka3);
}
return 1;
}