SA-MP Forums Archive
Pawn Errors Help Needed! - 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: Pawn Errors Help Needed! (/showthread.php?tid=208065)



Pawn Errors Help Needed! - Jack_Rocker - 07.01.2011

Hi, I need some help with these errors! I am pasting the code below, from line 82 - 97.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/hyd", cmdtext, true, 10) == 0)
    {
        if(gVIP[playerid] == 1)
  if(IsPlayerInAnyVehicle(playerid))
        SendClientMessage(playerid, COLOR_GREEN, "Hydraulics added to your vehicle!");
        AddVehicleComponent(vehicleid, 1087);
        else
        SendClientMessage(playerid, COLOR_RED, "You're not in a car!");
        else
        SendClientMessage(playerid, COLOR_RED, "You're not a VIP!");
        return 1;
    }
    return 0;
}
And here are the errors!

Код:
C:\Users\Jack\Desktop\samp\filterscripts\adminscript.pwn(89) : error 017: undefined symbol "vehicleid"
C:\Users\Jack\Desktop\samp\filterscripts\adminscript.pwn(90) : error 029: invalid expression, assumed zero
C:\Users\Jack\Desktop\samp\filterscripts\adminscript.pwn(92) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Thanks for helping!


Re: Pawn Errors Help Needed! - *IsBack - 07.01.2011

Quote:
Originally Posted by Jack_Rocker
Посмотреть сообщение
Hi, I need some help with these errors! I am pasting the code below, from line 82
Thanks for helping!
Wow you are really bad at pawn..
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/hyd", cmdtext, true, 10) == 0)
    {
        if(gVIP[playerid] == 1){
  if(IsPlayerInAnyVehicle(playerid)){
        SendClientMessage(playerid, COLOR_GREEN, "Hydraulics added to your vehicle!");
        AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);}
        else{
        SendClientMessage(playerid, COLOR_RED, "You're not in a car!");}
        else{
        SendClientMessage(playerid, COLOR_RED, "You're not a VIP!");}
        return 1;
    }
    return 0;
}



Re: Pawn Errors Help Needed! - Jack_Rocker - 07.01.2011

Quote:
Originally Posted by *IsBack
Посмотреть сообщение
Wow you are really bad at pawn..
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/hyd", cmdtext, true, 10) == 0)
    {
        if(gVIP[playerid] == 1){
  if(IsPlayerInAnyVehicle(playerid)){
        SendClientMessage(playerid, COLOR_GREEN, "Hydraulics added to your vehicle!");
        AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);}
        else{
        SendClientMessage(playerid, COLOR_RED, "You're not in a car!");}
        else{
        SendClientMessage(playerid, COLOR_RED, "You're not a VIP!");}
        return 1;
    }
    return 0;
}
Haha I now have 13 errors now! thanks -.-


Re: Pawn Errors Help Needed! - *IsBack - 07.01.2011

Quote:
Originally Posted by Jack_Rocker
Посмотреть сообщение
Haha I now have 13 errors now! thanks -.-
Well I guess those errors are not related to that command, right?
If no, post them, and I'll try to fix :P


Re: Pawn Errors Help Needed! - HyperZ - 07.01.2011

pawn Код:
if (strcmp("/hyd", cmdtext, true, 10) == 0)
{
    if(gVIP[playerid] >= 1)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(IsPlayerInAnyVehicle(playerid))
        {
            AddVehicleComponent(vehicleid, 1087);
            }else{
            SendClientMessage(playerid,0xFF0000AA,"You are not in a vehicle!!");
        }
    } else return SendClientMessage(playerid,0xFF0000AA,"You're not a VIP!");
    return 1;
}