CMD:veh(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] => 3)
{
new vehid;
new Float:x, Float:y, Float:z;
if(sscanf(params, "u", vehid)) return SendClientMessage(playerid, COLOR_RED, "Use /veh [vehicle id]");
else
{
GetPlayerPos(playerid, x, y, z);
CreateVehicle(vehid, x, y, z, 82.2873, 0, 0, 0);
)
}
else SendClientMessage(playerid, COLOR_RED, " ** You must be a level 3 Admin to use that! ");
return 1;
}
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(527) : warning 211: possibly unintended assignment
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(527) : error 029: invalid expression, assumed zero
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(527) : warning 215: expression has no effect
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(527) : error 001: expected token: ";", but found ")"
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(527) : error 029: invalid expression, assumed zero
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(527) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 * * Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
CMD:veh(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new vehid; new Float:x, Float:y, Float:z; if(sscanf(params, "u", vehid)) return SendClientMessage(playerid, COLOR_RED, "Use /veh [vehicle id]"); else { GetPlayerPos(playerid, x, y, z); CreateVehicle(vehid, x, y, z, 82.2873, 0, 0, 0); return 1; } } else return SendClientMessage(playerid, COLOR_RED, " ** You must be a level 3 Admin to use that! "); }
They are the lines im not stupid thats why i posted the whole command in which the line 527 is situated :P
|
you just showed the code with it errors , okay thats nice but how could I know the line which contain its certain error?
|
CMD:veh(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, " ** You must be a level 3 Admin to use that! ");
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Use /veh [vehicle id]");
if(strval(params) < 400 || strval(params) > 611) return SendClientMessage(playerid, COLOR_RED, "Invalid vehicle model.");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateVehicle(strval(params), x+2, y+2, z, 90.0, 0, 0, 0);
return 1;
}
'return' stops the code - therefore 'else' is a waste:
pawn Код:
- Coordinates shifted so vehicle doesn't spawn on top of players. - Sscanf removed - no need if there's only one parameter (also 'u' is a PLAYER, it won't work for a vehicle ID. |