#1

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.
Reply
#2

BUMB
Reply
#3

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;

Reply
#4

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.
Reply
#5

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.
Reply
#6

Bumb
Reply
#7

C'mon,
BUMB
Reply
#8

....
Reply
#9

Bumb, help
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)