Jump to content

putplayerinvehicle


Makena
 Share

Recommended Posts

CMD:putplayer(playerid,params[])

{

  if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an admin!");

new id, seatid;

  if(sscanf(params), "s[24]", playerid, vehicleid, seatid) return SendClientMessage(playerid, -1, "Ussage:/putplayer<playerid> <vehicleid> <seatid>");

if(playerid == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "Player not found!");

//if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You have to be in a car to use this command!"); trebue sa fii in masina ca sa foosesti comanda

if(seatid >= 4 || seatid < 1) return SendClientMessage(playerid, -1, "Invalid SeatID!");

new Float:pincX, Float:pincY, Float:pincZ, vehicleid, vehseat;

vehicleid = GetPlayerVehicleID(playerid);

vehicleid = GetPlayerVehicleSeat(id);

GetVehiclePos(vehicleid, pincX, pincY, pincZ);

PutPlayerInVehicle(playerid,vehicleid,seatid);

  return 1;

}

 

Ajutatima cu comanda asta ,vreu cind scriu comanda /putplayer sa scriu id la masina ,playerul si unde sa il pun pe player in masina adica la volan sau in alta parte,pls help ,unde am gresit ca imi da errori?

Link to comment
Share on other sites


CMD:putplayer(playerid,params[])

{

  if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an admin!");

new id, vehicleid, seatid;

  if(sscanf(params), "s[24]ii", id, vehicleid, seatid) return SendClientMessage(playerid, -1, "Ussage: /putplayer<playerid> <vehicleid> <seatid>");

if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "Player not found!");

//if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You have to be in a car to use this command!"); trebue sa fii in masina ca sa foosesti comanda

if(seatid >= 4 || seatid < 1) return SendClientMessage(playerid, -1, "Invalid SeatID!");

PutPlayerInVehicle(id, vehicleid, seatid);

  return 1;

}

 

incearca asa, daca iti da erori ceva posteaza aici 

*Comanda o asezi tu in gm*

 

P.S: nu stiu cum ai tu in gm, dar in locul if(!IsPlayerAdmin(playerid)) pune if(PlayerInfo[ playerid ][pAdmin] < 1) *sa nu lasi spatiu la playerid, eu am lasat ca apare ceva de la forum*

P.S2: daca ai ceva functie isplayeradmin lasa asa, daca nu pune ce ai mai sus (editezi tu pAdmin sau PlayerInfo daca ai altceva)

Edited by mihaissss
Link to comment
Share on other sites

 

CMD:putplayer(playerid,params[])
{
  if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an admin!");
new id, vehicleid, seatid;
  if(sscanf(params), "s[24]ii", id, vehicleid, seatid) return SendClientMessage(playerid, -1, "Ussage: /putplayer<playerid> <vehicleid> <seatid>");
if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "Player not found!");
//if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You have to be in a car to use this command!"); trebue sa fii in masina ca sa foosesti comanda
if(seatid >= 4 || seatid < 1) return SendClientMessage(playerid, -1, "Invalid SeatID!");
PutPlayerInVehicle(id, vehicleid, seatid);
  return 1;
}
 
incearca asa, daca iti da erori ceva posteaza aici 
*Comanda o asezi tu in gm*
 
P.S: nu stiu cum ai tu in gm, dar in locul if(!IsPlayerAdmin(playerid)) pune if(PlayerInfo[ playerid ][pAdmin] < 1) *sa nu lasi spatiu la playerid, eu am lasat ca apare ceva de la forum*
P.S2: daca ai ceva functie isplayeradmin lasa asa, daca nu pune ce ai mai sus (editezi tu pAdmin sau PlayerInfo daca ai altceva)

Nu vr sal fac in gm ,il fac in fs de aia folosesc IsPlayerAdmin.P.S - Ms acuma merge

Link to comment
Share on other sites

Se compilea

 

 

CMD:putplayer(playerid,params[])
{
  if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an admin!");
new id, vehicleid, seatid;
  if(sscanf(params), "s[24]ii", id, vehicleid, seatid) return SendClientMessage(playerid, -1, "Ussage: /putplayer<playerid> <vehicleid> <seatid>");
if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "Player not found!");
//if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You have to be in a car to use this command!"); trebue sa fii in masina ca sa foosesti comanda
if(seatid >= 4 || seatid < 1) return SendClientMessage(playerid, -1, "Invalid SeatID!");
PutPlayerInVehicle(id, vehicleid, seatid);
  return 1;
}
 
incearca asa, daca iti da erori ceva posteaza aici 
*Comanda o asezi tu in gm*
 
P.S: nu stiu cum ai tu in gm, dar in locul if(!IsPlayerAdmin(playerid)) pune if(PlayerInfo[ playerid ][pAdmin] < 1) *sa nu lasi spatiu la playerid, eu am lasat ca apare ceva de la forum*
P.S2: daca ai ceva functie isplayeradmin lasa asa, daca nu pune ce ai mai sus (editezi tu pAdmin sau PlayerInfo daca ai altceva)

 

Se compileaza dar nu il pune in masina ,nici nu scrie ca acel player nu este,posibil de la incuduri sa nu fie bune?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. 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.