11.04.2009, 06:30
I am trying to make a cmd, which will change a cars color every second, but I always get some sort of errors 
Here's the code:
I get these errors:
I am also a scripting beginner

Here's the code:
Код:
public OnPlayerConnect(playerid)
{
new timer1;
timer1 = SetTimer("rainbow",500,true); // 209
}
Код:
new PlayerRainbow[MAX_PLAYERS] = 0;
stock rainbow(playerid)
{
new ab, ac;
ab=rand(127);
ac=rand(127);
if (PlayerRainbow[playerid] = 1)
{
ChangeVehicleColor( vehicleid, ab, ac);
}
}
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/rainbowoff", cmdtext, true, 10) == 0)
{
KillTimer(timer1); //249
PlayerRainbow[playerid] = 0;
}
if (strcmp("/rainbow", cmdtext, true, 10) == 0)
{
PlayerRainbow[playerid] = 1;
}
}//I know this part of the code is poor, I will fix so you can only activate it in a car
Код:
C:\Documents and Settings\Tadej\Desktop\samp server\samp02Xserver.win32\gamemodes\monster.pwn(209) : warning 204: symbol is assigned a value that is never used: "timer1" C:\Documents and Settings\Tadej\Desktop\samp server\samp02Xserver.win32\gamemodes\monster.pwn(249) : error 017: undefined symbol "timer1"

