CMD:drift(playerid, params[])
{
new option[3];
if(!sscanf(params, "i[3]", option))
{
if(strcmp(option, "1", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vid;
vid = GetPlayerVehicleID(playerid);
SetPlayerPos(playerid,1264.5880, -2013.3972, 59.2888);
SetVehiclePos(vid,1264.5880, -2013.3972, 59.2888);
PutPlayerInVehicle(playerid,vid,0);
GameTextForPlayer(playerid, "You have been teleported to\n ~r~Drift 1", 3000, 5);
}
else
{
SetPlayerPos(playerid,1264.5880, -2013.3972, 59.2888);
GameTextForPlayer(playerid, "You have been teleported to\n ~r~Drift 1", 3000, 5);
}
return 1;
}
if(strcmp(option, "2", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vid;
vid = GetPlayerVehicleID(playerid);
SetPlayerPos(playerid,-299.6478, 1523.1639, 75.3594);
SetVehiclePos(vid,-299.6478, 1523.1639, 75.3594);
PutPlayerInVehicle(playerid,vid,0);
GameTextForPlayer(playerid, "You have been teleported to\n ~r~Drift 2", 3000, 5);
}
else
{
SetPlayerPos(playerid,-299.6478, 1523.1639, 75.3594);
GameTextForPlayer(playerid, "You have been teleported to\n ~r~Drift 2", 3000, 5);
}
return 1;
}
if(strcmp(option, "3", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vid;
vid = GetPlayerVehicleID(playerid);
SetPlayerPos(playerid,-2401.7813, -594.6240, 132.6484);
SetVehiclePos(vid,-2401.7813, -594.6240, 132.6484);
PutPlayerInVehicle(playerid,vid,0);
GameTextForPlayer(playerid, "You have been teleported to\n ~r~Drift 3", 3000, 5);
}
else
{
SetPlayerPos(playerid,-2401.7813,-594.6240, 132.6484);
GameTextForPlayer(playerid, "You have been teleported to\n ~r~Drift 3", 3000, 5);
}
return 1;
}
else return GameTextForPlayer(playerid, "~r~USAGE : ~w~/Drift 1-3", 3000, 5);
}
else return GameTextForPlayer(playerid, "~r~USAGE : ~w~/Drift 1-3", 3000, 5);
}
[05:49:09] sscanf warning: Format specifier does not match parameter count. [05:49:11] sscanf warning: Format specifier does not match parameter count. [05:49:13] sscanf warning: Format specifier does not match parameter count.
new option;
if(!sscanf(params, "i", option))
{
switch(option)
{
case 1: {
...
}
}
}
"i[3]"
"i"
if(!sscanf(params, "i[3]", option))
if(!sscanf(params, "i", option))
You don't need arrays for integers, so remove the [3] from the option, and also, on your sscanf line:
pawn Код:
pawn Код:
Best of luck. |
You really don't need ANY of all that unless you have more than 9 options (10 with "0" as a valid option):
pawn Код:
|