20.10.2010, 07:06
Give this a try (havnt tested need your functions) hope it works
Advice: Use the correct size arrays for strings/names. In sscanf the 'u' specifier is for names so use 'd' if its an integer value.
pawn Код:
COMMAND:request(playerid, params[])
{
new id;
if(sscanf(params,"d", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /request [orgid]");
new string[128],Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
if(IsInOrg[playerid] == 1) return SendClientMessage(playerid, red," You are already in a organisation!");
if(IsRequesting[playerid] == 1) return SendClientMessage(playerid, red," You are already requesting to join an organisation!");
if(id == 1)
{
format(string,128,"* %s is requesting to join San Andreas Police Dept.",Name);
SendClientMessageToAll(0xFFFFFFFF,string);
request[playerid] = 1;
IsRequesting[playerid] = 1;
return 1;
}
if(id == 2)
{
format(string,128,"* %s is requesting to join San Andreas Street Racers.",Name);
SendClientMessageToAll(0xFFFFFFFF,string);
request[playerid] = 1;
IsRequesting[playerid] = 1;
}
return 1;
}