[help] To write the command -
klebysom - 21.01.2017
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;
}
Re: [help] To write the command -
klebysom - 21.01.2017
.......................
Re: [help] To write the command -
Sew_Sumi - 22.01.2017
What's happening?
And what are you trying to do?
Re: [help] To write the command -
AbyssMorgan - 22.01.2017
What programming language it is this code XD
Re: [help] To write the command -
princejeet1510 - 22.01.2017
What was that lol
Re: [help] To write the command -
Sew_Sumi - 22.01.2017
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.
Re: [help] To write the command -
BiosMarcel - 22.01.2017
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(playerid, params[])
{
new tmp [256], tmp2 [256], idx;
tmp = strtok(params, idx);
tmp2 = strtok(params, idx);
if (!strlen (tmp)) return 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))
{
if (sscanf (params, "s")) return SendClientMessage (playerid, COR_BRANCO, "Usage: / grid [create]");
new Float: X, Float: Y, Float: Z, Float: 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)
{
// FIX THIS ---------> ", Player [playerid] [pGrade], getPName (playerid), CheckOrg (playerid);
}
else
{
format(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))
{
if (!strlen(tmp2))
{
return 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!");
// FIX THIS ---------> (I.e.
else if (strcmp (tmp2, "id", true) == 0)
{
new id,
remover /*UNUSED*/;
if (sscanf (params, "i", id)) return 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.");
}
}
else
{
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;
}
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.