Help me fix these errors please?
#1

(3846) : warning 211: possibly unintended assignment

pawn Код:
if(PlayerInfo[playerid][pCarLic] = 0) return SendClientMessageEx(playerid, COLOR_RED, "You're driving without a drivers license. Obtain one from City Hall!");
(3819 : warning 204: symbol is assigned a value that is never used: "rand"

pawn Код:
new rand = random(2);
(46530) : warning 211: possibly unintended assignment

pawn Код:
if(PlayerInfo[playerid][pModel] = 299) {
(73147) : warning 203: symbol is never used: "IsAtNameChange"

pawn Код:
}
Reply
#2

pawn Код:
if(PlayerInfo[playerid][pCarLic] == 0) return SendClientMessageEx(playerid, COLOR_RED, "You're driving without a drivers license. Obtain one from City Hall!");

new rand == random(2);

if(PlayerInfo[playerid][pModel] == 299) {
As for the last warning: click CTRL+F, search for "new IsAtNameChange" and delete it, or just for "IsAtNameChange" and see if it's used within that function. Hope it helps.
Reply
#3

(3173) : error 017: undefined symbol "Random"
(3176) : error 017: undefined symbol "Random"
(3180) : error 017: undefined symbol "GivePlayerValidWeapon"
(3181) : error 017: undefined symbol "GivePlayerValidWeapon"
(3182) : error 017: undefined symbol "GivePlayerValidWeapon"
(3183) : error 017: undefined symbol "GivePlayerValidWeapon"
(3184) : error 017: undefined symbol "GivePlayerValidWeapon"
(3186) : error 017: undefined symbol "GetPlayerNameEx"
(3194) : error 017: undefined symbol "GetPlayerNameEx"
(3201) : error 017: undefined symbol "GetPlayerNameEx"
(3210) : error 017: undefined symbol "GetPlayerNameEx"
(3224) : error 017: undefined symbol "GetPlayerNameEx"
(3231) : error 017: undefined symbol "GetPlayerNameEx"
(323 : error 017: undefined symbol "GetPlayerNameEx"
(3245) : error 017: undefined symbol "GetPlayerNameEx"
(3253) : error 017: undefined symbol "GetPlayerNameEx"
(3260) : error 017: undefined symbol "GetPlayerNameEx"
(3267) : error 017: undefined symbol "GetPlayerNameEx"
(3273) : error 017: undefined symbol "Random"
(327 : error 017: undefined symbol "GetPlayerNameEx"
(3285) : error 017: undefined symbol "GetPlayerNameEx"
(3292) : error 017: undefined symbol "GetPlayerNameEx"
(3300) : error 017: undefined symbol "GetPlayerNameEx"
(3306) : error 017: undefined symbol "GetPlayerNameEx"
(3311) : error 017: undefined symbol "GetPlayerNameEx"
(3314) : error 017: undefined symbol "GetPlayerNameEx"

I did change it, but now I get these errors.
Reply
#4

Weird errors, but I need to define them right? But where?
Reply
#5

Bump
Reply
#6

(3173) : error 017: undefined symbol "Random"
(3176) : error 017: undefined symbol "Random"
(3180) : error 017: undefined symbol "GivePlayerValidWeapon"
(3181) : error 017: undefined symbol "GivePlayerValidWeapon"
(3182) : error 017: undefined symbol "GivePlayerValidWeapon"
(3183) : error 017: undefined symbol "GivePlayerValidWeapon"
(3184) : error 017: undefined symbol "GivePlayerValidWeapon"
(3186) : error 017: undefined symbol "GetPlayerNameEx"
(3194) : error 017: undefined symbol "GetPlayerNameEx"
(3201) : error 017: undefined symbol "GetPlayerNameEx"
(3210) : error 017: undefined symbol "GetPlayerNameEx"
(3224) : error 017: undefined symbol "GetPlayerNameEx"
(3231) : error 017: undefined symbol "GetPlayerNameEx"
(323 : error 017: undefined symbol "GetPlayerNameEx"
(3245) : error 017: undefined symbol "GetPlayerNameEx"
(3253) : error 017: undefined symbol "GetPlayerNameEx"
(3260) : error 017: undefined symbol "GetPlayerNameEx"
(3267) : error 017: undefined symbol "GetPlayerNameEx"
(3273) : error 017: undefined symbol "Random"
(327 : error 017: undefined symbol "GetPlayerNameEx"
(3285) : error 017: undefined symbol "GetPlayerNameEx"
(3292) : error 017: undefined symbol "GetPlayerNameEx"
(3300) : error 017: undefined symbol "GetPlayerNameEx"
(3306) : error 017: undefined symbol "GetPlayerNameEx"
(3311) : error 017: undefined symbol "GetPlayerNameEx"
(3314) : error 017: undefined symbol "GetPlayerNameEx"




pawn Код:
new randgift = Random(1, 100);
        if(randgift >= 1 && randgift <= 83)
        {
            new gift = Random(1, 12);
            if(gift == 1)
            {
                if(PlayerInfo[giveplayerid][pConnectTime] < 1 || PlayerInfo[giveplayerid][pWRestricted] > 0 || PlayerInfo[giveplayerid][pDonateRank] > 2) return GiftPlayer(playerid, giveplayerid);
                GivePlayerValidWeapon(giveplayerid, 27, 60000);
                GivePlayerValidWeapon(giveplayerid, 24, 60000);
                GivePlayerValidWeapon(giveplayerid, 31, 60000);
                GivePlayerValidWeapon(giveplayerid, 34, 60000);
                GivePlayerValidWeapon(giveplayerid, 29, 60000);
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a full weapon set!");
                format(string, sizeof(string), "* %s was just gifted a full weapon set, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 2)
            {
                if(PlayerInfo[giveplayerid][pDonateRank] > 2) return GiftPlayer(playerid, giveplayerid);
                PlayerInfo[giveplayerid][pFirstaid]++;
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a first aid kit!");
                format(string, sizeof(string), "* %s was just gifted a first aid kit, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 3)
            {
                PlayerInfo[giveplayerid][pMats] += 2000;
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 2,000 materials!");
                format(string, sizeof(string), "* %s was just gifted 2,000 materials, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 4)
            {
                if(PlayerInfo[giveplayerid][pWarns] != 0)
                {
                    PlayerInfo[giveplayerid][pWarns]--;
                    SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a single warning removal!");
                    format(string, sizeof(string), "* %s was just gifted a single warning removal, enjoy!", GetPlayerNameEx(giveplayerid));
                    ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else
                {
                    SendClientMessageEx(giveplayerid, COLOR_GRAD2, "Random gift ended up in a removal of one warning - let's try again!");
                    GiftPlayer(playerid, giveplayerid);
                    return 1;
                }
            }
            else if(gift == 5)
            {
                PlayerInfo[giveplayerid][pPot] += 50;
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 50 grams of pot!");
                format(string, sizeof(string), "* %s was just gifted 50 grams of pot, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 6)
            {
                PlayerInfo[giveplayerid][pCrack] += 25;
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 25 grams of crack!");
                format(string, sizeof(string), "* %s was just gifted 25 grams of crack, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 7)
            {
                GivePlayerCash(giveplayerid, 20000);
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won $20,000!");
                format(string, sizeof(string), "* %s was just gifted $20,000, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 8)
            {
                PlayerInfo[giveplayerid][pPaintTokens] += 10;
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 10 paintball tokens!");
                format(string, sizeof(string), "* %s was just gifted 10 paintball tokens, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 9)
            {
                if(PlayerInfo[giveplayerid][pDonateRank] < 1) return GiftPlayer(playerid, giveplayerid);
                PlayerInfo[giveplayerid][pTokens] += 5;
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 5 VIP tokens!");
                format(string, sizeof(string), "* %s was just gifted 5 VIP tokens, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 10)
            {
                PlayerInfo[giveplayerid][pFirework] += 2;
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 2 Fireworks!");
                format(string, sizeof(string), "* %s was just gifted 2 Fireworks, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 11)
            {
                PlayerInfo[giveplayerid][pExp] += 5;
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 5 Respect Points!");
                format(string, sizeof(string), "* %s was just gifted 5 Respect Points, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
        }
        else if(randgift > 83 && randgift <= 98)
        {
            new gift = Random(1, 9);
            if(gift == 1)
            {
                GivePlayerCash(giveplayerid, 150000);
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won $150,000!");
                format(string, sizeof(string), "* %s was just gifted $150,000, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 2)
            {
                PlayerInfo[giveplayerid][pMats] += 15000;
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 15,000 materials!");
                format(string, sizeof(string), "* %s was just gifted 15,000 materials, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 3)
            {
                PlayerInfo[giveplayerid][pExp] += 10;
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 10 respect points!");
                format(string, sizeof(string), "* %s was just gifted 10 respect points, enjoy!", GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(gift == 4)
            {
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a free car!");
                SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This rare reward may take up to 48 hours to be rewarded, contact Shop Techs.");
                format(PlayerInfo[giveplayerid][pFlag], 128, "Free Car (Gift)");
                format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won a free car.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ABroadCast(COLOR_YELLOW, string, 4);
                if(playerid != MAX_PLAYERS)
                {
                    new year,month,day,log[128];
                    getdate(year, month, day);
                    format(log, sizeof(log), "AdmCmd: %s has just gifted %s and he won a free car(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
                    Log("logs/gifts.log", log);
                } else {
                    new year,month,day,log[128];
                    getdate(year, month, day);
                    format(log, sizeof(log), "AdmCmd: %s was just gifted by the system and he won a free car(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
                    Log("logs/gifts.log", log);
                }
                format(string, sizeof(string), "* %s was just gifted a free car, enjoy!", GetPlayerNameEx(giveplayerid));
Reply
#7

PHP код:
#define (blah blah blah) (value if you have/need one) 
Like that above, make sure you define somewhere the script part that needs it can see/use it, recommend you make it gobal varible/define.
Reply
#8

Add this into your script.
pawn Код:
stock GetPlayerNameEx(playerid)
{
     new pname[MAX_PLAYER_NAME];
     GetPlayerName(playerid, pname, sizeof(pname));
     return pname;
}
For the errors relating to random:
PAWN is case-sensitive. The correct way to get a random number between 1 and 100 is this:
pawn Код:
random(1 - 100);
Reply
#9

Quote:
Originally Posted by KevinPRINCE
Посмотреть сообщение
PHP код:
#define (blah blah blah) (value if you have/need one) 
Like that above, make sure you define somewhere the script part that needs it can see/use it, recommend you make it gobal varible/define.
Why the heck you post in the topic if you don't know the answer??

@CameronNSRP,

You've to create a stock for the following:

GetPlayerNameEx
GivePlayerValidWeapon

and

Random..

DBan already create the stock for you for the GetPlayerNameEx.
Reply


Forum Jump:


Users browsing this thread: 9 Guest(s)