Help please - 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: Help please (
/showthread.php?tid=218594)
Help please -
bartje01 - 30.01.2011
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.
Re: Help please -
Mauzen - 30.01.2011
if(playerid[racersx][racers] >= 1)
playerid is just a number, not an array. Probably you wanted to use a global array here.
Re: Help please -
bartje01 - 30.01.2011
Then how to fix it? I want that everyone with the variable "racers" will be able to move : O
Re: Help please -
Mauzen - 30.01.2011
Impossible to say. Just check what variable you set for the players for "racers".
Re: Help please -
bartje01 - 30.01.2011
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?
Re: Help please -
Mauzen - 30.01.2011
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
Re: Help please -
bartje01 - 30.01.2011
Well, the variable : racers is :
new racers[MAX_PLAYERS];
So not using an enum or smthing
Re: Help please -
bartje01 - 30.01.2011
WORKS

yahoooo
Thankyaa
Re: Help please -
Mean - 30.01.2011
This was not an enum + you can't use playerid like that there!
Re: Help please -
bartje01 - 31.01.2011
Jup, just as I tought. But I didn't know how to do it without playerid xD I do know now thanks to Tupac.