Pawn Errors Help Needed!
#1

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!
Reply
#2

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;
}
Reply
#3

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 -.-
Reply
#4

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
Reply
#5

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)