WHAT"S WRONG WITH IT! It does'nt look too complicated! I'm sure my zcmd works fine cause my other LONGER and MUCH MORE COMPLICATED commands work fine!
PHP код:
COMMAND:afrakcja(playerid, params[])
{
new cmd[128], string[128], otherstring[128], idfrakcji;
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "s", cmd) != 0)
{
return SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja <nazwa | komendy | rangi | skiny | spawn>");
}
if(strcmp("nazwa", cmd, true, 5) == 0)
{
new nazwa[128];
if(!sscanf(params, "sds", cmd, idfrakcji, nazwa))
{
if(idfrakcji >= 1 && idfrakcji <=20)
{
new zdanie[128];
format(otherstring, sizeof(otherstring),"Faction_%d/FactionName",idfrakcji); format(string, sizeof(string), "%s", nazwa); djSet(FACTIONS_FILE,otherstring,string,true);
djCommit(FACTIONS_FILE);
format(zdanie, sizeof(zdanie), "[O-RP "VERSION"] Zmieniłeś nazwę frakcji [%d] na %s", idfrakcji, string);
SendClientMessage(playerid, COLOR_WHITE, zdanie);
}
else return SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] ID frakcji nie może być niższe od 1 i wyższe od 20!");
}
else return SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja nazwa <id> <nazwa>");
}
if(strcmp("komendy", cmd, true, 7) == 0)
{
new typkomend;
if(!sscanf(params, "sdd", cmd, idfrakcji, typkomend))
{
new zdanie[128];
format(otherstring, sizeof(otherstring),"Faction_%d/CommandsType",idfrakcji); djSetInt(FACTIONS_FILE,otherstring,typkomend,true);
djCommit(FACTIONS_FILE);
format(zdanie, sizeof(zdanie), "[O-RP "VERSION"] Zmieniłeś typ komend frakcji [%d] na [%d]", idfrakcji, typkomend);
SendClientMessage(playerid, COLOR_WHITE, zdanie);
}
else return SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja komendy <id> <typ komend>");
}
if(strcmp("rangi", cmd, true, 5) == 0)
{
new ranga, nazwarangi[128];
if(!sscanf(params, "sdds", cmd, idfrakcji, ranga, nazwarangi))
{
new zdanie[128];
format(otherstring, sizeof(otherstring),"Faction_%d/Rank%d",idfrakcji, ranga); format(string, sizeof(string), "%s", nazwarangi); djSet(FACTIONS_FILE,otherstring,string,true);
djCommit(FACTIONS_FILE);
format(zdanie, sizeof(zdanie), "[O-RP "VERSION"] Zmieniłeś nazwe rangi %d, frakcji [%d] na %s", ranga, idfrakcji, string);
SendClientMessage(playerid, COLOR_WHITE, zdanie);
}
else return SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja rangi <id> <id rangi> <nazwa rangi>");
}
if(strcmp("skiny", cmd, true, 5) == 0)
{
new idslotu, idskinu;
if(!sscanf(params, "sddd", cmd, idfrakcji, idslotu, idskinu))
{
new zdanie[128];
format(otherstring, sizeof(otherstring),"Faction_%d/Skin%d",idfrakcji, idslotu); djSetInt(FACTIONS_FILE,otherstring,idskinu,true);
djCommit(FACTIONS_FILE);
format(zdanie, sizeof(zdanie), "[O-RP "VERSION"] Zmieniłeś ID skinu nr.%d na %d, dla frakcji [%d]", idslotu, idskinu, idfrakcji);
SendClientMessage(playerid, COLOR_WHITE, zdanie);
}
else return SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja skiny <id> <id slotu> <idskinu>");
}
if(strcmp("spawn", cmd, true, 5) == 0)
{
if(!sscanf(params, "sd", cmd, idfrakcji))
{
new zdanie[128], Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
format(otherstring, sizeof(otherstring),"Faction_%d/X",idfrakcji); djSetFloat(FACTIONS_FILE,otherstring,x,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Y",idfrakcji); djSetFloat(FACTIONS_FILE,otherstring,y,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Z",idfrakcji); djSetFloat(FACTIONS_FILE,otherstring,z,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Interior",idfrakcji); djSetInt(FACTIONS_FILE,otherstring,GetPlayerInterior(playerid),true);
djCommit(FACTIONS_FILE);
format(zdanie, sizeof(zdanie), "[O-RP "VERSION"] Ustawiłeś spawn frakcji [%d] na %f %f %f oraz %d interior.", idfrakcji, x, y, z, GetPlayerInterior(playerid));
SendClientMessage(playerid, COLOR_WHITE, zdanie);
}
else return SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja spawn <id>");
}
}
return 1;
}
You're using the wrong brace (should be parenthesis). Also forgot a return.
Thanks. I was ready to throw my comp outta window -.-