[help] To write the command
#1

Good to make command / degree of my decision to improve and incur other commands to do so it is not working
Код:
Dcmd_grade (playerid, params [])
{
****#pragma params not used
****
****New tmp [256], tmp2 [256], idx;
Tmp = strtok (params, idx);
Tmp2 = strtok (params, idx);

*If (! Strlen (tmp)) returns SendClientMessage (playerid, COR_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] = 1 || Player [playerid] [pChoque]> = 1 || Player [playerid] [pAdministrator]> = 1 || Player [playerid] [pBOPE]> = 1 || Player [playerid] [pHelper]> = 30 | Player [playerid] [pReporter]> = 1)
{
********If (strcmp (tmp, "create", true) == 0)
{
If (sscanf (params, "s")) returns SendClientMessage (playerid, COR_BRANCO, "Usage: / grid [create]");
New Float: X, Float: Y, Float: Z, Floating: A; New String [128];
GetPlayerPos (playerid, X, Y, Z);
GetPlayerFacingAngle (playerid, A);
Player [playerid] [pGrade] ++;
Object [playerid] = CreateObject (980, X, Y, Z + 1.7, 0,0, 0,0, A);
********ObjectID [playerid] = Object [playerid];
SetPlayerPos (playerid, X, Y, Z + 5.2);

Format (String, sizeof String, "Object ID: [% d]", Object [playerid]);

********If (Player [playerid] [pGrade]> -1)
", Player [playerid] [pGrade], getPName (playerid), CheckOrg (playerid);
Else (String, sizeof (String), "Grid created by% s \ n% s."), GetPName (playerid), CheckOrg (playerid);

Create3DTextLabel (String, -1, X, Y, Z, 15,0, 0, 0);
}
Else if (strcmp (tmp, "remove", true) == 0)
{
If (! Strlen (tmp2)) returns SendClientMessage (playerid, COR_BRANCO, "Usage: / degree remove [all / id]");
If (strcmp (tmp2, "all", true) == 0)
{
For (new i = 0; i <= MAX_GRADE; i ++)
*********{
DestroyObject (Player [i] [Grade]);
SendClientMessage (playerid, COR_ERRO, "[ERROR] {FFFFFF} You are not allowed to use this command!");
(I.e.
Else if (strcmp (tmp2, "id", true) == 0)
{
New id, remover;
**************If (sscanf (params, "i", id)) returns SendClientMessage (playerid, COR_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.");
********
**************Return true;
}
}other{
SendClientMessage (playerid, COR_BRANCO, "Usage: / degree [create / remove]");
Return 1;
}
} Else SendClientMessage (playerid, COR_ERRO, "[ERROR] {FFFFFF} You are not allowed to use this command!");
Return 1;
}
Reply
#2

.......................
Reply
#3

What's happening?

And what are you trying to do?
Reply
#4

What programming language it is this code XD
Reply
#5

What was that lol
Reply
#6

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
What programming language it is this code XD
I didn't notice that... Damn lol.. Must be the no-indents and the stars that threw me off.
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)