SA-MP Forums Archive
help cmd - 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: help cmd (/showthread.php?tid=660728)



help cmd - nbx2000 - 11.11.2018

help me with this command to arm is not compiled something is wrong help me?


new buylevel;
CMD:buylevel(playerid,params[])
{
if(GetPlayerMoney(playerid) > 18000)
if(buylevel == 2) //level!
{
new year,month,day; getdate(year, month, day); new hour,minute,second; gettime(hour,minute,second);
GivePlayerMoney(playerid, -18000)
dUserSetINT(PlayerName2(playerid)).("level",(buyle vel));
PlayerInfo[playerid][Level] = buylevel;
format(string,sizeof(string),"[DONATE] %s Level %d on %d/%d/%d at %d:%d:%d", PlayerName2(playerid),
buylevel, day, month, year, hour, minute, second); SendClientMessage(playerid,blue,string);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}
else SendClientMessage(playerid, COLOR_WHITE, "You don't have that much!");
return 1;
}


Re: help cmd - AndreiWow - 11.11.2018

I don't understand your sentence.


Re: help cmd - nbx2000 - 11.11.2018

Tell me what part you do not understand?


Re: help cmd - Leaky - 12.11.2018

Quote:
Originally Posted by nbx2000
Посмотреть сообщение
help me with this command to arm is not compiled something is wrong help me?

new buylevel;
CMD:buylevel(playerid,params[])
{
if(GetPlayerMoney(playerid) > 18000)
if(buylevel == 2) //level!
{
new year,month,day; getdate(year, month, day); new hour,minute,second; gettime(hour,minute,second);
GivePlayerMoney(playerid, -18000)
dUserSetINT(PlayerName2(playerid)).("level",(buyle vel));
PlayerInfo[playerid][Level] = buylevel;
format(string,sizeof(string),"[DONATE] %s Level %d on %d/%d/%d at %d:%d:%d", PlayerName2(playerid),
buylevel, day, month, year, hour, minute, second); SendClientMessage(playerid,blue,string);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}
else SendClientMessage(playerid, COLOR_WHITE, "You don't have that much!");
return 1;
}
Assuming that you had already set buylevel to a value, this would be the fix for your code not compiling. Also I'm assuming that you are assigning the buylevel variable to a player so change "new buylevel;" to "new buylevel[MAX_PLAYERS];" and use this in your codes/commands "buylevel(playerid);"

PHP код:
new buylevel;
CMD:buylevel(playerid,params[])
{
    if(
GetPlayerMoney(playerid) > 18000)
    {
        if(
buylevel == 2//level!
        
{
            new 
year,month,daygetdate(yearmonthday); new hour,minute,secondgettime(hour,minute,second);
            
GivePlayerMoney(playerid, -18000);
            
dUserSetINT(PlayerName2(playerid)).("level",(buylevel));
            
PlayerInfo[playerid][Level] = buylevel;
            
format(string,sizeof(string),"[DONATE] %s Level %d on %d/%d/%d at %d:%d:%d"PlayerName2(playerid),
            
buyleveldaymonthyearhourminutesecond); SendClientMessage(playerid,blue,string);
            
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        }
    }
    else 
SendClientMessage(playeridCOLOR_WHITE"You don't have that much!");
    return 
1;

You missed a few ";" and you missed "}"