[HELP]
#1

Hi,I make a command for personal vehicle to get my vehicle...
But,don't work so great,so,I need some help.
When I write,ex: /mycar 23,that work,and should not,cause,is not my personal car.
Photo: https://imgur.com/a/k2mQZ7b

And that is not everything,sometimes the command gives me that error: You don't have a personal car.

I will leave the command here,so,help me:

Код HTML:
CMD:mycar( playerid, params[ ] )
{
new vid = GetVehicleID(GetPlayerVehicleID(playerid));
//--------------------------------------------------------------------------
if(IsPlayerInAnyVehicle( playerid ) )
return SendError2( playerid, "{FFFFFF}Please exit your current vehicle, to call your vehicle !", "{FFFFFF}Trebuie sa iesi din vehicul pentru a folosi comanda respectiva" );
//--------------------------------------------------------------------------
if(CosminInfo[playerid][CarOwner])
return SendError2(playerid, "{FFFFFF}This car isn't yours!", "{FFFFFF}Aceasta masina nu este a ta");
//--------------------------------------------------------------------------
if(GetPlayerVehicles(playerid) == 0) return
SendError2(playerid, "{FFFFFF}You don't have a personal car", "{FFFFFF}Nu ai o masina personala");
//--------------------------------------------------------------------------
if(sscanf(params, "i", vid)) return
SendUsage(playerid, "/MyCar [Car ID]");
//--------------------------------------------------------------------------
new
Float:X,
Float:Y,
Float:Z,
Float:A
;
GetPlayerPos( playerid, X, Y, Z );
GetPlayerFacingAngle( playerid, A );

SetVehiclePos( vid, X, Y, Z );
SetVehicleZAngle( vid, A );
PutPlayerInVehicle( playerid, vid, 0 );

GameTextForPlayer( playerid, "~w~~h~You spawned your~n~~r~~h~personal vehicle.", 4000, 4);
return ( 1 );
}
Reply
#2

I recommend placing your command on the label
Код HTML:

to better detail it and help you.
Reply
#3

Quote:
Originally Posted by PaulCrouseVS
Посмотреть сообщение
I recommend placing your command on the label
Код HTML:

to better detail it and help you.
Done,now,you can see more good =)
Reply
#4

Quote:
Originally Posted by SeeNN
Посмотреть сообщение
When I write,ex: /mycar 23,that work,and should not,cause,is not my personal car.
Of course "/mycar 23" works because you don't have any checks after sscanf
You should check if the given vehicleid is one of the personal vehicles
Also using the vehicleid as identifier is questionable, use the index of your data structue instead
Reply
#5

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Of course "/mycar 23" works because you don't have any checks after sscanf
You should check if the given vehicleid is one of the personal vehicles
Also using the vehicleid as identifier is questionable, use the index of your data structue instead
I will see,and if that don't work,can be something else?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)