Error help "Assumed to zero"
#1

I have do this code to get a random function, but when i compiled, it got error
PHP код:
invaild assusmed to zero 
Code
PHP код:
CMD:chetaosung(playeridparams[])
{
    new 
string[128];
    if(
HungerPlayerInfo[playerid][hgInEvent] != 0) return SendClientMessageEx(playeridCOLOR_GREY"   You cannot do this while being in the Hunger Games Event!");
    if(
GetPVarInt(playerid"IsInArena") >= 0) {
        
SendClientMessageEx(playerid,COLOR_GREY,"   You cannot do this while being in a arena!");
        return 
1;
    }
       if(
GetPVarIntplayerid"EventToken") != 0)
    {
        
SendClientMessageEx(playeridCOLOR_GREY"You can't use this while you're in an event.");
        return 
1;
    }
    if (
PlayerInfo[playerid][pJob] != && PlayerInfo[playerid][pJob2] != 9) {
        
SendClientMessageEx(playerid,COLOR_GREY,"   Ban khong phai la Arms Dealer!");
        return 
1;
    }
    if(
WatchingTV[playerid] != 0) {
        
SendClientMessageEx(playeridCOLOR_GREY"You can not do this while watching TV!");
        return 
1;
    }
    if (
PlayerInfo[playerid][pScrewdriver] == 0) {
        
SendClientMessageEx(playerid,COLOR_GREY,"   Ban can mot chiec tua vit tu Nguoi Che Tao (craftsman) de tao sung!");
        return 
1;
    }
    if (
PlayerInfo[playerid][pJailTime] > 0) {
        
SendClientMessageEx(playerid,COLOR_GREY,"   You can not make guns while in jail or prison!");
        return 
1;
    }
    if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playeridCOLOR_GREY"Ban khong the lam dieu do vao luc nay.");
    if (
GetPVarInt(playerid"ArmsTimer") > 0) {
        
format(stringsizeof(string), "   Ban phai doi %d giay nua truoc khi ban co the ban vu khi khac."GetPVarInt(playerid"ArmsTimer"));
        
SendClientMessageEx(playerid,COLOR_GREY,string);
        return 
1;
    }
    if(
PlayerInfo[playerid][pHospital] > 0) {
        
SendClientMessageEx(playeridCOLOR_GREY"You can't spawn a weapon whilst in Hospital.");
        return 
1;
    }
    if(!
IsPlayerInRangeOfPoint(playerid202266.2012,-1588.1500,1494.1938))
    return 
SendClientMessageEx(playeridCOLOR_GREY"Ban khong o trong nha may che tao sung, ban da duoc set checkpoint de den do.");
    
SetPlayerCheckpoint(playerid, -115.9948,-314.2656,2.764615.0);
    
    new 
giveplayerid,x_weapon[20],weapon,price,storageid;
    
/*// Find the storageid of the storagedevice.
    new bool:itemEquipped = false;
    for(new i = 0; i < 3; i++)
    {
        if(StorageInfo[playerid][i][sAttached] == 1) {
            storageid = i;
            itemEquipped = true;
        }
    }
    if(itemEquipped == false) return SendClientMessageEx(playerid, COLOR_WHITE, "ban khong co a storage device equipped! - /storagehelp");
    */
    
if(sscanf(params"us[20]"giveplayeridx_weapon)) {
        
SendClientMessageEx(playeridCOLOR_GREEN"________________________________________________");
        
SendClientMessageEx(playeridCOLOR_YELLOW"<< Available weapons >>");
        new 
level PlayerInfo[playerid][pArmsSkill];
        if(
level >= && level 50) {
            
SendClientMessageEx(playeridCOLOR_GRAD1"sdpistol(100)    flowers(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"9mm(150)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"shotgun(200)    knuckles(25)");
        }
        else if(
level >= 50 && level 100) {
            
SendClientMessageEx(playeridCOLOR_GRAD1"sdpistol(100)    flowers(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"9mm(150)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"shotgun(200)    knuckles(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"mp5(400)        baseballbat(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"rifle(1000)        cane(25)");
        }
        else if(
level >= 100 && level 200) {
            
SendClientMessageEx(playeridCOLOR_GRAD1"sdpistol(100)    flowers(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"9mm(150)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"shotgun(200)    knuckles(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"mp5(400)        baseballbat(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"rifle(1000)        cane(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"deagle(8000)    shovel(25)");
        }
        else if(
level >= 200 && level 400) {
            
SendClientMessageEx(playeridCOLOR_GRAD1"sdpistol(100)    flowers(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"9mm(150)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"shotgun(200)    knuckles(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"mp5(400)           baseballbat(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"rifle(1000)        cane(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"deagle(8000)    shovel(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"golfclub(25)    poolcue(25)");
        }
        else if(
level >= 400) {
            
SendClientMessageEx(playeridCOLOR_GRAD1"sdpistol(100)    flowers(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"shotgun(200)    knuckles(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"mp5(400)        baseballbat(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"rifle(1000)        cane(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"deagle(8000)    shovel(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"golfclub(25)    poolcue(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"dildo(25)        katana(25)");
            
SendClientMessageEx(playeridCOLOR_GRAD1"uzi(1250)      tec9(1250)");
        }
        if(
PlayerInfo[playerid][pDonateRank] >= 3)
        {
               
SendClientMessageEx(playeridCOLOR_YELLOW"Gold+ VIP Feature: AK-47(10000)");
        }
        
SendClientMessageEx(playeridCOLOR_GREEN"________________________________________________");
        
SendClientMessageEx(playeridCOLOR_GREY"SUDUNG: /sellgun [player] [weaponname]");
        return 
1;
    }
    if(!
IsPlayerConnected(giveplayerid)) {
        return 
SendClientMessageEx(playeridCOLOR_GRAD2"Nguoi choi khong hop le.");
    }
    if(
HungerPlayerInfo[giveplayerid][hgInEvent] != 0) return SendClientMessageEx(playeridCOLOR_GREY"   This person is not able to receive weapons at the moment.");
    if(
strcmp(x_weapon,"dildo",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 400) return SendClientMessageEx(playeridCOLOR_GREY" You are not the required level to create that!");
        if(
PlayerInfo[playerid][pMats] > 24) {
            
weapon 10price 25;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"katana",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 400) return SendClientMessageEx(playeridCOLOR_GREY" You are not the required level to create that!");
        if(
PlayerInfo[playerid][pMats] > 24) {
            
weapon 8price 25;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"ak47",true) == 0) {
        if(
PlayerInfo[playerid][pDonateRank] < 3) return SendClientMessageEx(playeridCOLOR_GREY" Ban khong phai la Gold VIP+!");
        if(
PlayerInfo[playerid][pMats] >= 10000) {
            
weapon 30price 10000;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"golfclub",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 200) return SendClientMessageEx(playeridCOLOR_GREY" You are not the required level to create that!");
        if(
PlayerInfo[playerid][pMats] > 24) {
            
weapon 2price 25;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"poolcue",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 200) return SendClientMessageEx(playeridCOLOR_GREY" You are not the required level to create that!");
        if(
PlayerInfo[playerid][pMats] > 24) {
            
weapon 7price 25;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"shovel",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 100) return SendClientMessageEx(playeridCOLOR_GREY" You are not the required level to create that!");
        if(
PlayerInfo[playerid][pMats] > 24) {
            
weapon 6price 25;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"cane",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 50) return SendClientMessageEx(playeridCOLOR_GREY" You are not the required level to create that!");
        if(
PlayerInfo[playerid][pMats] > 24) {
            
weapon 15price 25;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"baseballbat",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 50) return SendClientMessageEx(playeridCOLOR_GREY" You are not the required level to create that!");
        if(
PlayerInfo[playerid][pMats] > 24) {
            
weapon 5price 25;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"knuckles",true) == 0) {
        if(
PlayerInfo[playerid][pMats] > 24) {
            
weapon 1price 25;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"sdpistol",true) == 0) {
        if(
PlayerInfo[playerid][pMats] > 99) {
            
weapon 23price 100;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"flowers",true) == 0) {
        if(
PlayerInfo[playerid][pMats] > 24) {
            
weapon 14price 25;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"deagle",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 100) return SendClientMessageEx(playeridCOLOR_GREY" You are not the required level to create that!");
        if(
PlayerInfo[playerid][pMats] > 7999) {
            
weapon 24price 8000;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"mp5",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 50) return SendClientMessageEx(playeridCOLOR_GREY" You are not the required level to create that!");
        if(
PlayerInfo[playerid][pMats] > 399) {
            
weapon 29price 400;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   khong du Materials cho viec do Weapon!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"uzi",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 400) return SendClientMessageEx(playeridCOLOR_GREY"ban khong a high enough level to craft this item!");
        if(
PlayerInfo[playerid][pMats] > 1249) {
            
weapon 28price 1250;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"tec9",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 400) return SendClientMessageEx(playeridCOLOR_GREY"ban khong a high enough level to craft this item!");
        if(
PlayerInfo[playerid][pMats] > 1249) {
            
weapon 32price 1250;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"shotgun",true) == 0) {
        if(
PlayerInfo[playerid][pMats] > 199) {
            
weapon 25price 200;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"9mm",true) == 0) {
        if(
PlayerInfo[playerid][pMats] > 149) {
            
weapon 22price 150;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else if(
strcmp(x_weapon,"rifle",true) == 0) {
        if(
PlayerInfo[playerid][pArmsSkill] < 50) return SendClientMessageEx(playeridCOLOR_GREY" You are not the required level to create that!");
        if(
PlayerInfo[playerid][pMats] > 999) {
            
weapon 33price 1000;
        }
        else {
            
SendClientMessageEx(playerid,COLOR_GREY,"   Khong du Vat Lieu (Materials) de che tao sung!");
            return 
1;
        }
    }
    else { 
SendClientMessageEx(playerid,COLOR_GREY,"   Invalid Weapon name!"); return 1; }
    if (
ProxDetectorS(5.0playeridgiveplayerid)) {
        if(
PlayerInfo[giveplayerid][pConnectHours] < || PlayerInfo[giveplayerid][pWRestricted] > 0) return SendClientMessageEx(playeridCOLOR_GRAD2"That person is currently restricted from possessing weapons!");
        new 
ball random(3);
        if(
ball == 1)
        if(
giveplayerid == playerid) {
            
format(stringsizeof(string), "   ban da given yourself a %s."x_weapon);
            
PlayerPlaySound(playerid10520.00.00.0);
            
SendClientMessageEx(playeridCOLOR_GRAD1string);
            
PlayerPlaySound(playerid10520.00.00.0);
            switch( 
PlayerInfo[playerid][pSex] ) {
                case 
1format(stringsizeof(string), "* %s da che tao mot khau sung tu Vat Lieu (Materials), va dua no cho anh ta."GetPlayerNameEx(playerid));
                case 
2format(stringsizeof(string), "* %s created a Gun from Materials, and hands it to herself."GetPlayerNameEx(playerid));
            }
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
GivePlayerValidWeapon(playerid,weapon,30);
            
PlayerInfo[playerid][pMats] -= price;
            if(
weapon 15)
            {
                if(
PlayerInfo[playerid][pDonateRank] == || PlayerInfo[playerid][pDonateRank] == 3)
                 {
                      
PlayerInfo[playerid][pArmsSkill] += 2;
                 }
                else if(
DoubleXP) {
                    
SendClientMessageEx(playeridCOLOR_YELLOW"Ban da nhan duoc 2 diem ki nang che sung thay vi 1. (Double XP Active)");
                    
PlayerInfo[playerid][pArmsSkill] += 2;
                    
PlayerInfo[playerid][pXP] += PlayerInfo[playerid][pLevel] * XP_RATE 2;
                }
                  else if(
PlayerInfo[playerid][pDoubleEXP] > && PlayerInfo[playerid][pDonateRank] < && !DoubleXP)
                {
                    
format(stringsizeof(string), "Ban da nhan duoc 2 diem ki nang che sung thay vi 1. Ban con %d tieng con lai trong Double EXP token."PlayerInfo[playerid][pDoubleEXP]);
                    
SendClientMessageEx(playeridCOLOR_YELLOWstring);
                    
PlayerInfo[playerid][pArmsSkill] += 2;
                    
PlayerInfo[playerid][pXP] += PlayerInfo[playerid][pLevel] * XP_RATE 2;
                }
                 else
                  {
                      
PlayerInfo[playerid][pArmsSkill]++;
                    
PlayerInfo[playerid][pXP] += PlayerInfo[playerid][pLevel] * XP_RATE;
                   }
            }
            if(
PlayerInfo[playerid][pAdmin] < 3) {
                
SetPVarInt(playerid"ArmsTimer"10); SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_ARMSTIMER);
            }
            if(
PlayerInfo[playerid][pArmsSkill] == 50)
            { 
SendClientMessageEx(playeridCOLOR_YELLOW"* Ki nang che tao sung cua ban da len level 2, ban se che tao sung duoc nhieu sung hon."); }
            else if(
PlayerInfo[playerid][pArmsSkill] == 100)
            { 
SendClientMessageEx(playeridCOLOR_YELLOW"* Ki nang che tao sung cua ban da len level 3, ban se che tao sung duoc nhieu sung hon."); }
            else if(
PlayerInfo[playerid][pArmsSkill] == 200)
            { 
SendClientMessageEx(playeridCOLOR_YELLOW"* Ki nang che tao sung cua ban da len level 4, ban se che tao sung duoc nhieu sung hon."); }
            else if(
PlayerInfo[playerid][pArmsSkill] == 400)
            { 
SendClientMessageEx(playeridCOLOR_YELLOW"* Ki nang che tao sung cua ban da len level 5, ban se che tao sung duoc nhieu sung hon."); }
            return 
1;
        }
        
format(stringsizeof(string), "* You offered %s to buy a %s."GetPlayerNameEx(giveplayerid), x_weapon);
        
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring);
        
format(stringsizeof(string), "* Nguoi che tao sung %s muon ban cho ban mot %s, (go /chapnhan gun) de mua."GetPlayerNameEx(playerid), x_weapon);
        
SendClientMessageEx(giveplayeridCOLOR_LIGHTBLUEstring);
        
GunOffer[giveplayerid] = playerid;
        
GunStorageID[giveplayerid] = storageid;
        
GunId[giveplayerid] = weapon;
        
GunMats[giveplayerid] = price;
         
SetPVarInt(giveplayerid"WeaponSeller_SQLId"GetPlayerSQLId(playerid));
        if(
PlayerInfo[playerid][pAdmin] < 3) {
            
SetPVarInt(playerid"ArmsTimer"10); SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_ARMSTIMER);
        }
    }
    else
    {
        
SendClientMessageEx(playeridCOLOR_GREY"Nguoi choi do khong o gan ban.");
    }
    else
    {
       
PlayerInfo[playerid][pMats] -= price;
    
SendClientMessageEx(playeridCOLOR_YELLOW"* Ban da that bai trong viec che tao sung :p.");
    }
    return 
1;

Error line
PHP код:
13131 
line
PHP код:
else 
Reply
#2

bump please help
Reply
#3

SHow us what else statement, paste it with a litttle bit code around it.
Reply
#4

here is it
Quote:

format(string, sizeof(string), "* You offered %s to buy a %s.", GetPlayerNameEx(giveplayerid), x_weapon);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Nguoi che tao sung %s muon ban cho ban mot %s, (go /chapnhan gun) de mua.", GetPlayerNameEx(playerid), x_weapon);
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
GunOffer[giveplayerid] = playerid;
GunStorageID[giveplayerid] = storageid;
GunId[giveplayerid] = weapon;
GunMats[giveplayerid] = price;
SetPVarInt(giveplayerid, "WeaponSeller_SQLId", GetPlayerSQLId(playerid));
if(PlayerInfo[playerid][pAdmin] < 3) {
SetPVarInt(playerid, "ArmsTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_ARMSTIMER);
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "Nguoi choi do khong o gan ban.");
}
else
{
PlayerInfo[playerid][pMats] -= price;
SendClientMessageEx(playerid, COLOR_YELLOW, "* Ban da that bai trong viec che tao sung .");
}
return 1;
}

Reply
#5

Is it the first or the second else statement?
Reply
#6

the second :<
Reply
#7

Where is this for?

PlayerInfo[playerid][pMats] -= price;
SendClientMessageEx(playerid, COLOR_YELLOW, "* Ban da that bai trong viec che tao sung .");

That should be handled on the /accept weapon, what's the message?
Reply
#8

U mean this ?
Quote:

format(string, sizeof(string), "* You offered %s to buy a %s.", GetPlayerNameEx(giveplayerid), x_weapon);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Nguoi che tao sung %s muon ban cho ban mot %s, (go /chapnhan gun) de mua.", GetPlayerNameEx(playerid), x_weapon);
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
GunOffer[giveplayerid] = playerid;
GunStorageID[giveplayerid] = storageid;
GunId[giveplayerid] = weapon;
GunMats[giveplayerid] = price;
SetPVarInt(giveplayerid, "WeaponSeller_SQLId", GetPlayerSQLId(playerid));
if(PlayerInfo[playerid][pAdmin] < 3) {
SetPVarInt(playerid, "ArmsTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_ARMSTIMER);
}
}

Reply
#9

Try to remove the last else statement and post what happend.
Reply
#10

I change and fix some.. i will post when compiled finish. Please wait
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)