Help please
#1

Hey guys. i'm working on a race script. But I'm stuck again.

pawn Код:
public dockstart(playerid)
{
for(new racersx;racersx < MAX_PLAYERS; racersx++)
{
if(playerid[racersx][racers] >= 1)
{
TogglePlayerControllable(racersx,1);
}
}
return 1;
}

Код:
C:\Users\Michael\Desktop\Samp scvripting\filterscripts\races.pwn(414) : error 028: invalid subscript (not an array or too many subscripts): "playerid"
C:\Users\Michael\Desktop\Samp scvripting\filterscripts\races.pwn(414) : warning 215: expression has no effect
C:\Users\Michael\Desktop\Samp scvripting\filterscripts\races.pwn(414) : error 001: expected token: ";", but found "]"
C:\Users\Michael\Desktop\Samp scvripting\filterscripts\races.pwn(414) : error 029: invalid expression, assumed zero
C:\Users\Michael\Desktop\Samp scvripting\filterscripts\races.pwn(414) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

if(playerid[racersx][racers] >= 1)

playerid is just a number, not an array. Probably you wanted to use a global array here.
Reply
#3

Then how to fix it? I want that everyone with the variable "racers" will be able to move : O
Reply
#4

Impossible to say. Just check what variable you set for the players for "racers".
Reply
#5

let say it on another way.

I want a timer that toggles the playercontrolabble with everyone that has the variable racers == 1.
How to do this?
Reply
#6

The same as before: You can use your code, but you have to change playerid to your correct variable array. I cant know what it is.

Example:
pawn Код:
if(gPlayers[racersx][racers] >= 1)
Replace gPlayers with your player array
Reply
#7

Well, the variable : racers is :

new racers[MAX_PLAYERS];

So not using an enum or smthing
Reply
#8

WORKS yahoooo
Thankyaa
Reply
#9

This was not an enum + you can't use playerid like that there!
Reply
#10

Jup, just as I tought. But I didn't know how to do it without playerid xD I do know now thanks to Tupac.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)