Something I've forgot -
bartje01 - 22.01.2011
Don't want to make another thread:
New problem is that I have a timer that needs to set your color to white if you're not in any faction.
It doesn't work :[
@top I have:
forward notfaction(playerid);
@ OnGameModeInit I have:
pawn Код:
SetTimer("notfaction",2000,true);
And my public
pawn Код:
public notfaction(playerid)
{
if(InFaction[playerid] == 0)
{
cop[playerid] = 0;
grove[playerid] = 0;
SetPlayerColor(playerid,COLOR_WHITE);
return 1;
}
return 1;
}
Re: Something I've forgot - [L3th4l] - 22.01.2011
pawn Код:
foreach(Player, i)
{
if(cop[i] >= 1)
{
// Code
}
}
Re: Something I've forgot -
Fj0rtizFredde - 22.01.2011
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(cop[i] >= 1 && IsPlayerConnected(i))
{
format(string,sizeof(string),"There are %d cop members",i);
SendClientMessageToAll(COLOR_YELLOW,string);
}
}
(Damn to slow

)
Re: Something I've forgot -
bartje01 - 22.01.2011
Don't want to make another thread:
New problem is that I have a timer that needs to set your color to white if you're not in any faction.
It doesn't work :[
@top I have:
forward notfaction(playerid);
@ OnGameModeInit I have:
pawn Код:
SetTimer("notfaction",2000,true);
And my public
pawn Код:
public notfaction(playerid)
{
if(InFaction[playerid] == 0)
{
cop[playerid] = 0;
grove[playerid] = 0;
SetPlayerColor(playerid,COLOR_WHITE);
return 1;
}
return 1;
}
Re: Something I've forgot -
bartje01 - 22.01.2011
Edited with a new problem!
Re: Something I've forgot -
WillyP - 22.01.2011
pawn Код:
public notfaction(playerid)
{
if(InFaction[playerid] == 0)
{
cop[playerid] = 0;
grove[playerid] = 0;
SetPlayerColor(playerid,COLOR_WHITE);
}
return 1;
}
Re: Something I've forgot -
bartje01 - 22.01.2011
Quote:
Originally Posted by [FU]Victious
pawn Код:
public notfaction(playerid) { if(InFaction[playerid] == 0) { cop[playerid] = 0; grove[playerid] = 0; SetPlayerColor(playerid,COLOR_WHITE); } return 1; }
|
It just sets ID 0 his color to white.
Even if he is in a faction : o
Re: Something I've forgot -
Fj0rtizFredde - 22.01.2011
Use SetTimerEx insteed
Re: Something I've forgot - [L3th4l] - 22.01.2011
pawn Код:
public OnPlayerConnect(playerid)
{
SetTimerEx("notfaction", 2000, true, "i", playerid);
return 1;
}
Re: Something I've forgot -
bartje01 - 22.01.2011
Still sets player id 0 to white when he is in a faction
And no effect for other players.
My things now:
@onplayerconnect
pawn Код:
SetTimerEx("notfaction", 2000, true, "i", playerid);
My public
pawn Код:
public notfaction(playerid)
{
if(InFaction[playerid] == 0)
{
cop[playerid] = 0;
grove[playerid] = 0;
SetPlayerColor(playerid,COLOR_WHITE);
}
return 1;
}
And my command to leave a faction. You possibly don't need this but still :P
pawn Код:
COMMAND:leavefaction(playerid,params[])
{
if(InFaction[playerid] <1) return SendClientMessage(playerid,COLOR_RED,"You're not even in any faction");
else
InFaction[playerid] = 0;
return 1;
}