17.09.2011, 22:41
Ok, so I decided to do jihost's thing
so I foudn this stock:
and added it in my GM (on the end)
then I made a test command:
but I get this warning:
error line:
its in the stock thing
so I foudn this stock:
pawn Код:
{
new bool:connected[MAX_PLAYERS] = false, amount = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i))
{
connected[i] = true;
amount++;
}
if(amount = 0) return -1;
new rand = random(amount), done = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
if(connected[i])
{
if(done == rand) return i;
done++;
}
return -1;
}
then I made a test command:
pawn Код:
if (strcmp("/test", cmdtext, true) == 0)
{
format(string,sizeof(string),"Test id:%d",GetRandomID());
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
Код:
C:\Users\William\Documents\Famous' World\Famous' World\gamemodes\Famous.pwn(8436) : warning 211: possibly unintended assignment Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.
pawn Код:
if(amount = 0) return -1;