26.08.2012, 03:02
Hello Everyone,
I was creating a faction system for myself. Everything stores fine and loads perfectly. I was creating a command to set someone the leader of a faction. So i made the code below. It works fine InGame , but the only problem is 'I want it to display the name of the faction too but it skips the faction name part. It is null. Nothing shows up in ClientMessage'.
The command just works fine only problem is the name of the faction does not show up.
Why exactly i dont see the name of the faction? The ID is fine and everything else. I save and load things using SQLite. Help will be appreciated a lot.
Thanks
I was creating a faction system for myself. Everything stores fine and loads perfectly. I was creating a command to set someone the leader of a faction. So i made the code below. It works fine InGame , but the only problem is 'I want it to display the name of the faction too but it skips the faction name part. It is null. Nothing shows up in ClientMessage'.
The command just works fine only problem is the name of the faction does not show up.
pawn Код:
COMMAND:afaction(playerid, params[])
{
new cmd[58];
if (sscanf(params, "s ", cmd) != 0)
{
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /afaction setleader");
}
if (strcmp("setleader", cmd, true, 10) == 0)
{
new factionid,player,string[95];
if (!sscanf(params, "sud", cmd, player,factionid))
{
if(player == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: That player is not connected.");
if(FactionExists(factionid))
{
Character[player][cFactionID] = factionid;
Character[player][cFactionRank] = 5;
format(string,sizeof(string),"You have been made the leader of the Faction: %s by an Admin.",Factions[factionid][fName]);
SendClientMessage(player,COLOR_GREEN,string);
}
else return SendClientMessage(playerid, COLOR_WHITE, "ERROR: That faction does not exist. Please check again");
}
else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /afaction setleader <playerid)> <factionid>");
}
return 1;
}
Why exactly i dont see the name of the faction? The ID is fine and everything else. I save and load things using SQLite. Help will be appreciated a lot.
Thanks