SA-MP Forums Archive
whats wrong with this - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: whats wrong with this (/showthread.php?tid=327949)



whats wrong with this - [LHT]Bally - 23.03.2012

its probably easy but im tired its 4:30am here

pawn Код:
#include <a_samp>
#include <zcmd>
#define Message_color 0xFF0000FF
new bool:pLightStatus[MAX_PLAYERS];//global variable
new pLightObject[MAX_PLAYERS];//global variable

//vUndercover[vehicleid] = false;
//Call that when you destroy the undercover vehicle

COMMAND:cid(playerid, params[])
{
    if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 285)
   {
    else
    {
            SendClientMessage(playerid,Message_color,"you are not a bus or taxi driver");
       
        new v = GetPlayerVehicleID(playerid);
        if(!pLightStatus[playerid])
        {
            pLightObject[playerid] = CreateObject(18646, 0.0001, 0.0200, -16.0000, 0, 0, 0);
            AttachObjectToVehicle(pLightObject[playerid], v, -0.34, -0.17, 0.64,   -2.00, 0.00, 4.00);
            pLightStatus[playerid] = true;
            return 1;
        }
        else
        {
            DestroyObject(pLightObject[playerid]);
            pLightStatus[playerid] = false;
            return 1;
        }
    }
}
pawn Код:
D:\stuff from reinstall\The Original\filterscripts\police.pwn(14) : error 029: invalid expression, assumed zero
D:\stuff from reinstall\The Original\filterscripts\police.pwn(18) : warning 217: loose indentation
D:\stuff from reinstall\The Original\filterscripts\police.pwn(36) : error 030: compound statement not closed at the end of file (started at line 12)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.



Re: whats wrong with this - Jonny5 - 23.03.2012

pawn Код:
if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 285)
   {
else
    {
this is missing code and a bracket, or maybe just a bracket

should be

pawn Код:
if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 285)
   {
    //some code here maybe?
    }
    else
    {

edit:

btw go to bed! lol