SA-MP Forums Archive
Neewbie needs help! - 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: Neewbie needs help! (/showthread.php?tid=244410)



Neewbie needs help! - Antonio144 - 27.03.2011

Hi ppl. I'm new to the pawno and I started to build my own GM.
I have encountered an error that I can't figure out
I get this error
PHP код:
 error 028invalid subscript (not an array or too many subscripts): "GetPlayerTeam"
 
warning 215expression has no effect
 
error 001expected token";"but found "]"
 
error 029invalid expressionassumed zero
 
fatal error 107too many error messages on one line 
in these lines http://pastebin.com/YEdXkbVy

Any help?


Re: Neewbie needs help! - iJumbo - 27.03.2011

paste the lines to ... like frist error what line is


Re: Neewbie needs help! - Zh3r0 - 27.03.2011

GetPlayerTeam uses ( ) not [ ] as it is a function, not a variable!
pawn Код:
if(GetPlayerTeam[playerid] != TEAM_COP || GetPlayerTeam[playerid] != TEAM_ARMY)
Solved:
pawn Код:
if(GetPlayerTeam(playerid) != TEAM_COP || GetPlayerTeam(playerid) != TEAM_ARMY)



Re: Neewbie needs help! - Antonio144 - 27.03.2011

Thnx that works. I tried that before but than it didn't work


Re: Neewbie needs help! - Antonio144 - 27.03.2011

Need help again

I get this error
PHP код:
(416) : error 004: function "IncreaseWantedLevel" is not implemented 
PHP код:
line 416 isIncreaseWantedLevel(playerid,4); 



Re: Neewbie needs help! - Zh3r0 - 27.03.2011

show us more code, what's near it and after also the function.


Re: Neewbie needs help! - Antonio144 - 27.03.2011

http://pastebin.com/yvAnZ91D


Re: Neewbie needs help! - HyperZ - 27.03.2011

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) == PoliceCar1 || GetPlayerVehicleID(playerid) == PoliceCar2 ||
        GetPlayerVehicleID(playerid) == PoliceCar3 || GetPlayerVehicleID(playerid) == PoliceCar4 ||
        GetPlayerVehicleID(playerid) == PoliceCar5 || GetPlayerVehicleID(playerid) == PoliceCar6 ||
        GetPlayerVehicleID(playerid) == PoliceCar7 || GetPlayerVehicleID(playerid) == PoliceCar8 ||
        GetPlayerVehicleID(playerid) == PoliceCar9 || GetPlayerVehicleID(playerid) == PoliceCar10 ||
        GetPlayerVehicleID(playerid) == PoliceCar11 || GetPlayerVehicleID(playerid) == PoliceCar12 ||
        GetPlayerVehicleID(playerid) == PoliceCar13 || GetPlayerVehicleID(playerid) == PoliceCar14 ||
        GetPlayerVehicleID(playerid) == PoliceCar15)
        {
            if(GetPlayerTeam(playerid) != TEAM_COP || GetPlayerTeam(playerid) != TEAM_ARMY)
            {
                SendClientMessage(playerid,0xA0A0A0FF,"[[_Law Enforcement Vehicle Theft_]]");
                SendClientMessage(playerid,0xEB0000FF,"You have stolen a Law Enforcement Vehicle. The police has been informed, watch out ..");
                SetPlayerWantedLevel(playerid, 4);
                return 1;
            }
        }
    }
    return 1;
}



Re: Neewbie needs help! - Zh3r0 - 27.03.2011

Quote:
Originally Posted by Antonio144
Посмотреть сообщение
I said show us the IncreaseWantedLevel function!

@Clive, damn forgot about that, seems that since I'm a non rp scripter, makes me forget these stuff


Re: Neewbie needs help! - armyoftwo - 27.03.2011

This line
pawn Код:
if(GetPlayerTeam(playerid) != TEAM_COP || GetPlayerTeam(playerid) != TEAM_ARMY)
Should be changed to:
pawn Код:
if(GetPlayerTeam(playerid) != TEAM_COP && GetPlayerTeam(playerid) != TEAM_ARMY)
Or it will bug.