My Scripting Questions
#1

I've wrotten this in the small scripting questions but nobody answers, so I hope I'll get help when I writte it in here:
Quote:

I don't know where the failure is. I scripted on OnPlayerEnterVehicle:

Код:
if(GetVehicleModel(vehicleid) == 400)
	{
	    if(landstal == false)
	    {
	        landstal = true;
	        SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
	        return 0;
		}
		else return 1;
	}
I scripted landstal as a boolean before:
Код:
new bool:landstal;
It should only one time give score +1; only when entering the vehicle for the first time, but it's giving score on every enter. What did I wrong?

Then, I've made this:
Код:
365:	new score = GetPlayerScore(playerid);
366:	if(score == 10 || =< 10)
367:	{
368:		TextDrawShowForPlayer(playerid, level0);
369:		return 1;
370:	}
371:	if(score => 11 && =< 100)
372:	{
373:	    TextDrawShowForPlayer(playerid, level1);
374:	    return 1;
375:	}
And the compiler says:

Код:
(366) : error 029: invalid expression, assumed zero
(371) : warning 211: possibly unintended assignment
(371) : error 029: invalid expression, assumed zero
(371) : error 029: invalid expression, assumed zero
(371) : error 029: invalid expression, assumed zero
(371) : fatal error 107: too many error messages on one line
It seems like the compiler doesn't like && and ||, but I've got a filterscript where it doesn't give an error, so why here? What did I wrong? Logically, should it work...
Reply
#2

pawn Код:
365:    new score = GetPlayerScore(playerid);
366:    if(score == 10 || score <= 10)
367:    {
368:        TextDrawShowForPlayer(playerid, level0);
369:        return 1;
370:    }
371:    if(score => 11 && score <= 100)
372:    {
373:        TextDrawShowForPlayer(playerid, level1);
374:        return 1;
375:    }
Reply
#3

Код:
365:	new score = GetPlayerScore(playerid);
366:	if(score == 10 || <= 10)
367:	{
368:		TextDrawShowForPlayer(playerid, level0);
369:		return 1;
370:	}
371:	if(score >= 11 && <= 100)
372:	{
373:	    TextDrawShowForPlayer(playerid, level1);
374:	    return 1;
375:	}
Try it like this.

EDIT: the guy above me was faster..
Reply
#4

pawn Код:
new bool:landstal[MAX_PLAYERS];

if(GetVehicleModel(vehicleid) == 400)
    {
        if(landstal[playerid] == false || !landstal[playerid])
        {
            landstal[playerid] = true;
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
            return 0;
        }
        else return 1;
    }
If the variable landstal for a certain player gets set to false in other code, it should be the reason the player gets a +1 whenever he enters
Reply
#5

Quote:
Originally Posted by moadi
Посмотреть сообщение
pawn Код:
new bool:landstal[MAX_PLAYERS];

if(GetVehicleModel(vehicleid) == 400)
    {
        if(landstal[playerid] == false || !landstal[playerid])
        {
            landstal[playerid] = true;
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
            return 0;
        }
        else return 1;
    }
If the variable landstal for a certain player gets set to false in other code, it should be the reason the player gets a +1 whenever he enters
Oh, ok I'll try.

BTW the score issue doesn't work, I'm still getting the same errors:
Код:
(366) : error 029: invalid expression, assumed zero
(366) : warning 215: expression has no effect
(366) : error 001: expected token: ";", but found ")"
(366) : error 029: invalid expression, assumed zero
(366) : fatal error 107: too many error messages on one line
The whole code:
pawn Код:
363:    public LvlTimer(playerid)
364:    {
365:        new score = GetPlayerScore(playerid);
366:        if(score == 10 || <= 10)
367:        {
368:            TextDrawShowForPlayer(playerid, level0);
369:            return 1;
370:        }
371:        if(score >= 11 && <= 100)
372:        {
373:            TextDrawShowForPlayer(playerid, level1);
374:            return 1;
375:        }
376:        if(score >= 101 && <= 500)
377:        {
378:            TextDrawShowForPlayer(playerid, level2);
379:            return 1;
380:        }
381:        return 1;
382:    }
I don't get it...
Reply
#6

The bool issue isn't also fixed. Server console shows on every startup
Код:
[13:30:28] Script[gamemodes/shit.amx]: Run time error 20: "Invalid index parameter (bad entry point)"
[13:30:28] Number of vehicle models: 5
Is that normal? What does it mean? I am using 0.3d RC9, may it be an RC issue?
Reply
#7

//PUSH, no way to fix?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)