SA-MP Forums Archive
Error! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error! (/showthread.php?tid=244432)



Error! - Mr_Scripter - 27.03.2011

I HAve Maded vnos For Vip level 3 but it gives a error
here is the code and do i need to put #pragma unused params ?
pawn Код:
CMD:vnos(playerid,params[])
{
    if(GetPVarInt(playerid, "vip") < 3) return SendClientMessage(playerid, 0xFF0000FF, "Your not a vip.");
        if(IsPlayerInAnyVehicle(playerid)) {
            switch(GetVehicleModel( GetPlayerVehicleID(playerid) )) {
                case 448,461,462,463,468,471,509,510,521,522,523,581,586,449:
                return SendClientMessage(playerid,red,"ERROR: You can not tune this vehicle!");
            }
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            return PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
        } else return SendClientMessage(playerid,red,"ERROR: You must be in a vehicle.");
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Error
pawn Код:
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\TDM.pwn(720) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.



Re: Error! - Raimis_R - 27.03.2011

1. Yes you need put in the script #pragma unused params
2. Where you puting command


Re: Error! - Mr_Scripter - 27.03.2011

At The Top Of Script
pawn Код:
CMD:vnos(playerid,params[])
{
    #pragma unused params
    if(GetPVarInt(playerid, "vip") < 3) return SendClientMessage(playerid, 0xFF0000FF, "Your not a vip.");
        if(IsPlayerInAnyVehicle(playerid)) {
            switch(GetVehicleModel( GetPlayerVehicleID(playerid) )) {
                case 448,461,462,463,468,471,509,510,521,522,523,581,586,449:
                return SendClientMessage(playerid,red,"ERROR: You can not tune this vehicle!");
            }
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            return PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
        } else return SendClientMessage(playerid,red,"ERROR: You must be in a vehicle.");
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Error Line
pawn Код:
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");



Re: Error! - Mr_Scripter - 27.03.2011

Still Can't Fix It i don't see any problem? Can someone help me?


Re: Error! - jaami - 27.03.2011

Hm..... which error it gives?


Re: Error! - Mr_Scripter - 27.03.2011

it's there already look up and no help?


Re: Error! - JamesC - 27.03.2011

The else statement is not linked to any conditional statement at all!

Also, you do not need a #pragma unused params in ZCMD.


Re: Error! - armyoftwo - 27.03.2011

pawn Код:
CMD:vnos(playerid,params[])
{
    if(GetPVarInt(playerid, "vip") < 3) {
        if(IsPlayerInAnyVehicle(playerid)) {
            switch(GetVehicleModel( GetPlayerVehicleID(playerid) )) {
                case 448,461,462,463,468,471,509,510,521,522,523,581,586,449:
                return SendClientMessage(playerid,red,"ERROR: You can not tune this vehicle!");
            }
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            return PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
        } else return SendClientMessage(playerid,red,"ERROR: You must be in a vehicle.");
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}



Re: Error! - Mr_Scripter - 27.03.2011

thanks but i fixed it and the pragma thing is in my script and it works fine