20.04.2012, 20:42
Hi, I am getting a compiling error, It does not detect Randon()
Код:
C:\Users\sean mcelholm\Desktop\SAN-RP Scripting - PRIVATE\gamemodes\vg-dm.pwn(373) : error 017: undefined symbol "Random" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
pawn Код:
public OnPlayerWinContest(playerid)
{
new string[128], prize = Random(1, 10);//Error is here.
if(prize == 1)
{
format(string,sizeof string,"[Server] Congratulations to %s who has won the contest and has won a Sniper!",GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOUR_LIGHTBLUE,string);
GivePlayerWeaponEx(playerid,34,999999);
}
if(prize == 2)
{
format(string,sizeof string,"[Server] Congratulations to %s who has won the contest and has won a Rocket launcher!",GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOUR_LIGHTBLUE,string);
GivePlayerWeaponEx(playerid,35,999999);
}
if(prize == 3)
{
format(string,sizeof string,"[Server] Congratulations to %s who has won the contest and has won a Minigun!",GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOUR_LIGHTBLUE,string);
GivePlayerWeaponEx(playerid,38,999999);
}
if(prize == 4)
{
format(string,sizeof string,"[Server] Congratulations to %s who has won the contest and has won a Sachel Charge!",GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOUR_LIGHTBLUE,string);
GivePlayerWeaponEx(playerid,39,999999);
GivePlayerWeaponEx(playerid,40,999999);
}
if(prize == 5)
{
format(string,sizeof string,"[Server] Congratulations to %s who has won the contest and has won a Knife!",GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOUR_LIGHTBLUE,string);
GivePlayerWeaponEx(playerid,4,999999);
}
if(prize == 6)
{
format(string,sizeof string,"[Server] Congratulations to %s who has won the contest and has won Gold Donator status",GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOUR_LIGHTBLUE,string);
PlayerInfo[playerid][pDonator] = 3;
}
if(prize == 7)
{
format(string,sizeof string,"[Server] Congratulations to %s who has won the contest and has won Silver Donator status",GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOUR_LIGHTBLUE,string);
PlayerInfo[playerid][pDonator] = 2;
}
if(prize == 8)
{
format(string,sizeof string,"[Server] Congratulations to %s who has won the contest and has won Bronze Donator status",GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOUR_LIGHTBLUE,string);
PlayerInfo[playerid][pDonator] = 1;
}
if(prize == 9)
{
format(string,sizeof string,"[Server] Congratulations to %s who has won the contest and has won armour",GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOUR_LIGHTBLUE,string);
SetPlayerArmour(playerid, 100.0);
}
ContestAnswer = -1;
return 1;
}