SA-MP Forums Archive
Invalid Symbol - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Invalid Symbol (/showthread.php?tid=336020)



Invalid Symbol - seanny - 20.04.2012

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;
}



Re: Invalid Symbol - Richie© - 20.04.2012

random, without capital letters


Re: Invalid Symbol - WLSF - 20.04.2012

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


Re: Invalid Symbol - Macluawn - 20.04.2012

https://sampwiki.blast.hk/wiki/Random


Re: Invalid Symbol - seanny - 20.04.2012

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


Re: Invalid Symbol - JhnzRep - 20.04.2012

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


Re: Invalid Symbol - [KHK]Khalid - 20.04.2012

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?