25.01.2014, 18:47
So, eh, I created the command /vipcar, and it should allow you to choose one of the 4 cars.
For an example:
/vipcar Caddy
It would spawn you, and put you in a Caddy.
But, it doesn't let me select it, it just puts me in the Infernus.
Here's the code
I suppose that I've done something wrong at the "else if(sscanf.....))", but what?
Maybe the "i"?
EDIT:
If somebody fixes this, could you explain me what did you change?
Because i would need to fix /vipbike, /vipboat and /vipheli too then.
For an example:
/vipcar Caddy
It would spawn you, and put you in a Caddy.
But, it doesn't let me select it, it just puts me in the Infernus.
Here's the code
pawn Код:
CMD:vipcar(playerid, params[]) {
new string[84], car;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
new Float:Angle;
GetPlayerFacingAngle(playerid, Angle);
if(PlayerInfo[playerid][pVIP] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "[VIP] - Only VIPS can use this command!");
new infernus, bullet, caddy, sultan;
if(sscanf(params, "i", infernus))
{
car = CreateVehicle(411, x,y,z, Angle, random(128), random(128), 180);
PutPlayerInVehicle(playerid, car, 0);
new sender[MAX_PLAYER_NAME];
GetPlayerName(playerid, sender, sizeof(sender));
format(string, sizeof(string), "[ADMIN] - VIP %s[%d] has used VIPCAR", sender, playerid);
format(string, sizeof(string), "[VIP] - %s[%d] has used VIPCAR", sender, playerid);
SendMessageToVIPS(string);
}
else if(sscanf(params, "i", bullet))
{
car = CreateVehicle(541, x,y,z, Angle, random(128), random(128), 180);
PutPlayerInVehicle(playerid, car, 0);
new sender[MAX_PLAYER_NAME];
GetPlayerName(playerid, sender, sizeof(sender));
format(string, sizeof(string), "[ADMIN] - VIP %s[%d] has used VIPCAR", sender, playerid);
format(string, sizeof(string), "[VIP] - %s[%d] has used VIPCAR", sender, playerid);
SendMessageToVIPS(string);
}
else if(sscanf(params, "i", sultan))
{
car = CreateVehicle(560, x,y,z, Angle, random(128), random(128), 180);
PutPlayerInVehicle(playerid, car, 0);
new sender[MAX_PLAYER_NAME];
GetPlayerName(playerid, sender, sizeof(sender));
format(string, sizeof(string), "[ADMIN] - VIP %s[%d] has used VIPCAR", sender, playerid);
format(string, sizeof(string), "[VIP] - %s[%d] has used VIPCAR", sender, playerid);
SendMessageToVIPS(string);
}
else if(sscanf(params, "i", caddy))
{
car = CreateVehicle(457, x,y,z, Angle, random(128), random(128), 180);
PutPlayerInVehicle(playerid, car, 0);
new sender[MAX_PLAYER_NAME];
GetPlayerName(playerid, sender, sizeof(sender));
format(string, sizeof(string), "[ADMIN] - VIP %s[%d] has used VIPCAR", sender, playerid);
format(string, sizeof(string), "[VIP] - %s[%d] has used VIPCAR", sender, playerid);
SendMessageToVIPS(string);
}
return 1;
}
Maybe the "i"?
EDIT:
If somebody fixes this, could you explain me what did you change?
Because i would need to fix /vipbike, /vipboat and /vipheli too then.