SA-MP Forums Archive
help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help (/showthread.php?tid=602175)



help - ZToPMaN - 03.03.2016

pawn Код:
CMD:getinveh[playerid,params[]){
new id;
 if(sscanf(params, "d", id)) return SendClientMessage(playerid, -1,"Usage: /drag [ID]");
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"Error:You must be in car to use this command!");
        if(IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, -1,"Error:This player is in car, You can't use this command!");
                  new vehicle, Float:vx, Float:vy, Float:vz;
                  vehicle = GetPlayerVehicleID(playerid);
                  GetVehiclePos(vehicle, vx, vy, vz);
                  PutPlayerInVehicle(id, vehicle, 1);
return 1;
}
No errors, but there is a problem, When i write getinveh, it don't get the player in the vehh.


Re: help - ZToPMaN - 03.03.2016

BUMB


Re: help - rambalili2 - 03.03.2016

put this under your new variables

PHP код:
new dragvehicle[MAX_PLAYERS]; 
under your commands

PHP код:
CMD:drag[playerid,params[])
{
    new 
id;
     if(
sscanf(params"d"id)) return SendClientMessage(playerid, -1,"Usage: /drag [ID]");
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"Error:You must be in car to use this command!");
    if(
IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, -1,"Error:This player is in car, You can't use this command!");
      
PutPlayerInVehicle(iddragvehicle[playerid], 1);
      return 
1;




Re: help - Richie© - 03.03.2016

1: use the u specifier in sscanf.
2: check if player is online.
3: check if there is a free seat available.
4: you should probably check if players is nearby, coz now you can put a player inside the vehicle no matter where he is.


Re: help - ZToPMaN - 03.03.2016

Quote:
Originally Posted by rambalili2
Посмотреть сообщение
put this under your new variables

PHP код:
new dragvehicle[MAX_PLAYERS]; 
under your commands

PHP код:
CMD:drag[playerid,params[])
{
    new 
id;
     if(
sscanf(params"d"id)) return SendClientMessage(playerid, -1,"Usage: /drag [ID]");
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"Error:You must be in car to use this command!");
    if(
IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, -1,"Error:This player is in car, You can't use this command!");
      
PutPlayerInVehicle(iddragvehicle[playerid], 1);
      return 
1;

I had alot of errors with dat, still not working.


Re: help - ZToPMaN - 04.03.2016

Bumb


Re: help - ZToPMaN - 04.03.2016

C'mon,
BUMB


Re: help - ZToPMaN - 04.03.2016

....


Re: help - ZToPMaN - 04.03.2016

Bumb, help


Re: help - Kar - 05.03.2016

pawn Код:
CMD:getinveh[playerid,params[]){
    new id;
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "Usage: /drag [ID]");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Error: You must be in car to use this command!");
    if(IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, -1, "Error: This player is in car, You can't use this command!");
    PutPlayerInVehicle(id, GetPlayerVehicleID(playerid), 1);
    return 1;
}