Problem With Script
#1

Well, what I want to do is have someone's wanted level recorded to FightClubWantedLevel when they enter the fight club (which is a DMing area) and when they leave, I want them to have their wanted level set back to what it was when they entered (because the killing in the club will cause their wanted level to go up). I am just giving you guys a little sample code so you can try and help me on what may be wrong. Thanks in advance guys!:

Код:
#include <a_samp>

forward WantedLevelFightClub();
forward WantedLevelFightClubExit();
// This is for the entrance to the Fight Club:
new FightClubWantedLevel[MAX_PLAYERS];

public WantedLevelFightClub()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
new FCWantedOne = GetPlayerWantedLevel(i);
{
FightClubWantedLevel[i] = FCWantedOne;
}
}
}
// And this is for the exit:
public WantedLevelFightClubExit()
{
for (new i = 0; i < MAX_PLAYERS; i++);
{
new FCWanted = FightClubWantedLevel[i];
{
SetPlayerWantedLevel(i, FCWanted);
}
}
}
And the errors:

Код:
C:\Users\Gamer\Desktop\Stuff\FlightClubWantedLevel.pwn(21) : error 036: empty statement
C:\Users\Gamer\Desktop\Stuff\FlightClubWantedLevel.pwn(23) : error 017: undefined symbol "i"
C:\Users\Gamer\Desktop\Stuff\FlightClubWantedLevel.pwn(25) : error 017: undefined symbol "i"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#2

***EDIT*** someone did it
Reply
#3

what are the lines 21,23 and 25?

(I do not want your money)
Reply
#4

Change "i" to "playerid", it may work
Reply
#5

Try:

pawn Код:
forward WantedLevelFightClub(playerid);
forward WantedLevelFightClubExit(playerid);

new FightClubWantedLevel[MAX_PLAYERS];

public WantedLevelFightClub(playerid)
{
new FCWantedOne = GetPlayerWantedLevel(playerid);
FightClubWantedLevel[playerid] = FCWantedOne;
}

public WantedLevelFightClubExit(playerid)
{
new FCWanted = FightClubWantedLevel[playerid];
SetPlayerWantedLevel(playerid, FCWanted);
}
Reply
#6

Quote:
Originally Posted by [LRP
Sayaron ]
Change "i" to "playerid", it may work
That wouldn't change a thing.

pawn Код:
#include <a_samp>

forward WantedLevelFightClub();
forward WantedLevelFightClubExit();
// This is for the entrance to the Fight Club:
new FightClubWantedLevel[MAX_PLAYERS];

public WantedLevelFightClub()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        FightClubWantedLevel[i] = GetPlayerWantedLevel(i);
    }
}

// And this is for the exit:
public WantedLevelFightClubExit()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        SetPlayerWantedLevel(i, FightClubWantedLevel[i]);
    }
}
There's a working, shorter version of your code. And the problem was in your second loop.

for (new i = 0; i < MAX_PLAYERS; i++); - That little guy at the end
Reply
#7

Really!

Change:

pawn Код:
for (new i = 0; i < MAX_PLAYERS; i++);
to

pawn Код:
for (new i = 0; i < MAX_PLAYERS; i++)
So small! 0o
Reply
#8

-.- it worked Thank you so much! And I'm just clarifying this have someone's wanted level recorded to FightClubWantedLevel when they enter the fight club and when they leave, their wanted level will be set back to what it was when they entered?
Reply
#9

Yes.
Reply
#10

Quote:
Originally Posted by ► © The LuxurioN™
So small! 0o
that's what she said
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)