Invalid Symbol
#1

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;
}
Reply
#2

random, without capital letters
Reply
#3

pawn Код:
random(value);
https://sampwiki.blast.hk/wiki/Random
Reply
#4

https://sampwiki.blast.hk/wiki/Random
Reply
#5

Quote:
Originally Posted by Richie©
Посмотреть сообщение
random, without capital letters
Thanks! Rep+'ed
Reply
#6

Don't make it Random, try random, with a lower case r.
Reply
#7

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)