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;
}
Yea and why are you starting with if(prize == 1) and not if(prize == 0)? in pawn we start with 0 or do you mean that?