public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { TuneVehicleRandomly(vehicleid); return SendClientMessage(playerid,-1,"Your car has been tuned."); return 1; } return 0; }
C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(212) : error 017: undefined symbol "vehicleid"
i have this code
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { vehicleid = GetPlayerVehicle; TuneVehicleRandomly(vehicleid); return SendClientMessage(playerid,-1,"Your car has been tuned."); return 1; } return 0; } Код:
C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(212) : error 017: undefined symbol "vehicleid" Please help! |
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
vehicleid = GetPlayerVehicle;
TuneVehicleRandomly(vehicleid);
return SendClientMessage(playerid,-1,"Your car has been tuned.");
return 1;
}
return 0;
}
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
TuneVehicleRandomly(vehicleid);
return SendClientMessage(playerid,-1,"Your car has been tuned.");
return 1;
}
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)){
TuneVehicleRandomly(GetPlayerVehicleID(playerid));
SendClientMessage(playerid,-1,"Your car has been tuned.");
return 1;
} else return SendClientMessage(playerid, 0xFF0000FF, "You are not in a car."),1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Your car has not been tuned as you're not in one.");
TuneVehicleRandomly(GetPlayerVehicleID(playerid));
return SendClientMessage(playerid,-1,"Your car has been tuned.");
}
return 0;
}
This should work
pawn Код:
|
C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(32) : warning 217: loose indentation C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(41) : warning 217: loose indentation C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(41) : warning 213: tag mismatch C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(208) : error 017: undefined symbol "vehicleid" C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(208) : error 017: undefined symbol "GetPlayerVehicle" C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(208) : warning 215: expression has no effect C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(209) : warning 217: loose indentation C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(209) : error 017: undefined symbol "vehicleid" C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(210) : warning 217: loose indentation C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(211) : warning 225: unreachable code C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(211) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
Change this:
pawn Код:
pawn Код:
|
C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(32) : warning 217: loose indentation C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(41) : warning 217: loose indentation C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(41) : warning 213: tag mismatch C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(204) : error 010: invalid function or declaration C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(206) : error 010: invalid function or declaration C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(207) : error 021: symbol already defined: "TuneVehicleRandomly" C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(207) : error 017: undefined symbol "playerid" C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(207) : error 010: invalid function or declaration C:\Users\Acer\Desktop\sЂrvЂr\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\filterscripts\randomtuning.pwn(207 -- 209) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors.
pawn Код:
I've added a check to ensure the player is even in a vehicle too, and removed the pointless return. |