30.05.2015, 18:57
I find this way much easier:
PHP код:
CMD:gang(playerid, params[])
{
new
tmp_name[50];
if (!sscanf(params, "'create's[50]", tmp_name))
{
if(gang[playerid][gid] != -1) return SendClientMessage(playerid,COLOR_GREEN, "[GANG]:{FFFFFF}Leave your gang with /gang leave before creating a new one!");
if(!(3 <= strlen(tmp_name) <= 49)) return SendClientMessage(playerid, COLOR_GREEN, "[GANG]:{FFFFFF} /gang create (GANG NAME)");
if(IsgangTaken(tmp_name)) return SendClientMessage(playerid, COLOR_GREEN, "[GANG]:{FFFFFF}gang name is already in use!");
Creategang(tmp_name, playerid);
}
else if (!strcmp(params, "leave", true))
{
// code for "/gang leave"
}
else SendClientMessage(playerid, COLOR_GREEN, "[GANG]:{FFFFFF} /gang <create (GANG NAME)/leave>");
return 1;
}