22.01.2017, 08:05
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.
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.
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;
}