Function not working? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Function not working? (
/showthread.php?tid=197840)
Function not working? -
Face9000 - 10.12.2010
Hi all,i'm making a "Crazy hour script" and i need little help.
I make this:
If server reach 70 players,the script wil activate the functions i write (ex. free health,new skin,weapons and etc.)
I tried on my local server,by lowering the player count to test the script,but dont work.
Ex: I tried:
Free armor.
Free sawnoff. Just for test,and nothing,both of this don't work.
Here is the script:
The new:
new pCount;
and the rest:
Код:
public OnPlayerConnect(playerid)
{
pCount++;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
pCount--;
return 1;
}
forward pChecking();
public pChecking()
{
if(pCount >= 2)
{
SendClientMessageToAll(RED, "Crazy Hour script activated.");
GivePlayerWeapon(playerid, 26, 500);
SetPlayerArmour(playerid, 100);
print("3 Players Joined!");
}
return 1;
}
Thanks for help.
Re: Function not working? -
Face9000 - 10.12.2010
BUMP...Please it's pretty urgent,sorry..
Re: Function not working? -
Face9000 - 11.12.2010
..........buummpp lool
Re: Function not working? -
[HUN]Jaki - 11.12.2010
pawn Код:
if(pCount >= 2){
SendClientMessageToAll(RED, "Crazy Hour script activated.");
for (new i=0; i<MAX_PLAYERS;i++){
If (!IsPlayerConnected(i)) continue;
GivePlayerWeapon(i, 26, 500);
SetPlayerArmour(i, 100);
}
print("3 Players Joined!");
}
return 1;
Re: Function not working? -
Face9000 - 11.12.2010
Tried but:
Код:
C:\Documents and Settings\k\Desktop\crazy.pwn(84) : error 017: undefined symbol "If"
C:\Documents and Settings\k\Desktop\crazy.pwn(84) : error 001: expected token: ";", but found "continue"
C:\Documents and Settings\k\Desktop\crazy.pwn(85) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Re: Function not working? -
WillyP - 11.12.2010
pawn Код:
forward pChecking();
public pChecking()
{
if(pCount >= 2)
{
SendClientMessageToAll(RED, "Crazy Hour script activated.");
GivePlayerWeapon(playerid, 26, 500);
SetPlayerArmour(playerid, 100);
print("3 Players Joined!");
}
return 1;
}
Did you assign a timer?
Re: Function not working? -
Face9000 - 11.12.2010
Nope,no timer in.
Re: Function not working? -
WillyP - 11.12.2010
Quote:
Originally Posted by Logitech90
Nope,no timer in.
|
Well add a timer?
Re: Function not working? -
Face9000 - 11.12.2010
How to?