[help] To write the command
#7

Love that he is still using dcmd though ^^

Anways, if you want help, remove the stars, stop starting keywords / varfiables (that exist as lowercase) with an uppercase letter, indent your code and don't make up an own version of Pawn in your ^^

Anyways, i help you a little.

PHP код:
Dcmd_grade(playeridparams[])
{
    new 
tmp [256], tmp2 [256], idx;
    
tmp strtok(paramsidx);
    
tmp2 strtok(paramsidx);
    if (!
strlen (tmp)) return SendClientMessage (playeridCOR_BRANCO"Usage: / grid [create / remove]");
    
// if (WorkOut [playerid] == 0) returns SendClientMessage (playerid, COR_ERRO, "[ERROR] {FFFFFF} You are not working to use this command!");
    
if([playerid][pA] == || Player[playerid][pChoque] >= || Player[playerid][pAdministrator] >= || Player[playerid][pBOPE] >= || Player[playerid][pHelper] >= 30 || Player[playerid][pReporter] >= 1)
    {
        if(!
strcmp (tmp"create"true))
        {
            if (
sscanf (params"s")) return SendClientMessage (playeridCOR_BRANCO"Usage: / grid [create]");
            new 
FloatXFloatYFloatZFloatA, new String [128];
            
GetPlayerPos (playeridXYZ);
            
GetPlayerFacingAngle (playeridA);
            
Player[playerid][pGrade]++;
            
Object[playerid] = CreateObject (980XY1.70,00,0A);
            
ObjectID[playerid] = Object[playerid];
            
SetPlayerPos (playeridXY5.2);
            
format (Stringsizeof String"Object ID: [% d]"Object [playerid]);
            if (
Player [playerid] [pGrade]> -1)
            {
                
// FIX THIS --------->    ", Player [playerid] [pGrade], getPName (playerid), CheckOrg (playerid);
            
}
            else 
            {
                
format(Stringsizeof(String), "Grid created by% s \ n% s."GetPName (playerid), CheckOrg (playerid));
            }
            
Create3DTextLabel(String, -1XYZ15,000);
        }
        else if(!
strcmp(tmp"remove"true))
        {
            if (!
strlen(tmp2))
            {
                return 
SendClientMessage (playeridCOR_BRANCO"Usage: / degree remove [all / id]");
            }
            if (
strcmp(tmp2"all"true) == 0)
            {
                for (new 
0<= MAX_GRADE++)
                {
                    
DestroyObject(Player[i][Grade]);
                    
SendClientMessage (playeridCOR_ERRO"[ERROR] {FFFFFF} You are not allowed to use this command!");
                    
// FIX THIS ---------> (I.e.
                        
else if (strcmp (tmp2"id"true) == 0)
                        {
                            new 
id,
                                
remover /*UNUSED*/;
                            if (
sscanf (params"i"id)) return SendClientMessage (playeridCOR_BRANCO"Usage: / degree remove [id]");
                            
SendClientMessage (playerid, -1"Press {C0C0C0} SHifT {FFFFFF} to move a camera.");
                            
DestroyObject (Player[id][pGrade]);
                            
SendClientMessage (playerid, -1"Press {C0C0C0} SHifT {FFFFFF} to move a camera.");
                        }
                    }
                    else
                    {
                        
SendClientMessage (playeridCOR_BRANCO"Usage: / degree [create / remove]");
                        Return 
1;
                    }
                } 
                else
                {
                    
SendClientMessage (playeridCOR_ERRO"[ERROR] {FFFFFF} You are not allowed to use this command!");
                } 
            }
        }
    }
    return 
1;

This is not working code though, the main focus was on making it readable at least, i really suggest you to watch some tutorials on coding.
Reply


Messages In This Thread
[help] To write the command - by klebysom - 21.01.2017, 20:42
Re: [help] To write the command - by klebysom - 21.01.2017, 21:50
Re: [help] To write the command - by Sew_Sumi - 22.01.2017, 04:08
Re: [help] To write the command - by AbyssMorgan - 22.01.2017, 04:46
Re: [help] To write the command - by princejeet1510 - 22.01.2017, 04:48
Re: [help] To write the command - by Sew_Sumi - 22.01.2017, 06:05
Re: [help] To write the command - by BiosMarcel - 22.01.2017, 08:05

Forum Jump:


Users browsing this thread: 1 Guest(s)