cmd /eat pizza
#1

PHP код:
CMD:eat(playeridparams[])
{
    new 
value;
    
value strval(params);
    if(
value == 1)
    {
        new 
str[159], Floathealthpkquery[259];
         
GetPlayerHealth(playeridhealthpk);
        if(
IsLimited[playerid] == true) return SendClientMessage(playerid, -1"{990000}You are not allowed to spawn with this command. Please wait few minutes.");
        if(
pInfo[playerid][Pizza] != 0){
        if(
healthpk == 100.0) return SendClientMessage(playerid, -"{39ac73}Can't eat it.");
        
SetPlayerHealth(playeridhealthpk+5);
        
pInfo[playerid][Pizza] -= 1;
         
mysql_format(g_SQLquerysizeof query"UPDATE `players` SET `pizza` = %d WHERE `id` = %d LIMIT 1"pInfo[playerid][Pizza], pInfo[playerid][ID]);
        
mysql_tquery(g_SQLquery);
        
format(strsizeof(str), "{39ac73}(pizza) You ate a pizza. %d left"pInfo[playerid][Pizza]);
        
beerlimited[playerid] = SetTimerEx("CanDrinkBeer"1000001"i"playerid); // 350000 = 5 minutes
        
IsLimited[playerid] = true;
        
SendClientMessage(playerid, -1str);}else{
        
format(strsizeof(str), "{39ac73}Hello %s, you don't have any pizza's left in your inventory."PlayerName[playerid]);
        
SendClientMessage(playerid, -1str);
        }
    }
    return 
1;

How can i make instea /eat 1 (1 = pizza) to /eat pizza ?
Reply


Messages In This Thread
cmd /eat pizza - by severance - 05.09.2018, 21:01
Re: cmd /eat pizza - by solstice_ - 05.09.2018, 21:04
Re: cmd /eat pizza - by severance - 05.09.2018, 21:22

Forum Jump:


Users browsing this thread: 1 Guest(s)