28.11.2011, 19:34
pawn Код:
COMMAND:request(playerid, params[])
{
new id;
new String[MAX_PLAYERS];
if(sscanf(params,"i", id))return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /request [orgid]");
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(playerid, Name, sizeof(Name));
if(PlayerInfo[playerid][IsInOrg] == 1) return SendClientMessage(playerid, red, "You are already in a organization!");
if(PlayerInfo[playerid][IsRequesting] == 1) return SendClientMessage(playerid, red," You are already requesting to join an organization!");
if(PlayerInfo[playerid][Leader] == id || PlayerInfo[playerid][Member] == id) return SCM(playerid, COLOR_GREY, "Your already in this organization");
for(new i = 0; i < MAX_PLAYERS; i++)
{ if(!IsPlayerConnected(i))
{ if(PlayerInfo[i][Leader] == id);
{ SendClientMessage(playerid, COLOR, "The leader of this organization is currently not online"); return 1;
}
}
}
if(id == 1)
{
format(String,MAX_PLAYERS,"* %s is requesting to join San Andreas Police Department.",Name);
SendClientMessageToAll(COLOR_ORANGE,String);
format(File,sizeof(File),AccountLocation, pName);
{
dini_IntSet(File, "Request",PlayerInfo[playerid][request] = 1);
dini_IntSet(File, "Isrequesting",PlayerInfo[playerid][IsRequesting] = 1);
return 1;
}
}
if(id == 2)
{
format(String,MAX_PLAYERS,"* %s is requesting to join National Guard.",Name);
SendClientMessageToAll(COLOR_ORANGE,String);
format(File,sizeof(File),AccountLocation, pName);
{
dini_IntSet(File, "Request",PlayerInfo[playerid][request] = 2);
dini_IntSet(File, "Isrequesting",PlayerInfo[playerid][IsRequesting] = 1);
return 1;
}
}
if(id == 3)
{
format(String,MAX_PLAYERS,"* %s is requesting to join San Andreas Fire Department.",Name);
SendClientMessageToAll(COLOR_ORANGE,String);
format(File,sizeof(File),AccountLocation, pName);
{
dini_IntSet(File, "Request",PlayerInfo[playerid][request] = 3);
dini_IntSet(File, "Isrequesting",PlayerInfo[playerid][IsRequesting] = 1);
return 1;
}
}
if(id == 4)
{
format(String,MAX_PLAYERS,"* %s is requesting to join The Sons Of Anarchy.",Name);
SendClientMessageToAll(COLOR_ORANGE,String);
format(File,sizeof(File),AccountLocation, pName);
{
dini_IntSet(File, "Request",PlayerInfo[playerid][request] = 4);
dini_IntSet(File, "Isrequesting",PlayerInfo[playerid][IsRequesting] = 1);
return 1;
}
}
if(id == 5)
{
format(String,MAX_PLAYERS,"* %s is requesting to join The Grove Street Families.",Name);
SendClientMessageToAll(COLOR_ORANGE,String);
format(File,sizeof(File),AccountLocation, pName);
{
dini_IntSet(File, "Request",PlayerInfo[playerid][request] = 5);
dini_IntSet(File, "Isrequesting",PlayerInfo[playerid][IsRequesting] = 1);
return 1;
}
}
return 1;
}
Check the brackets, I just pasted your code in but it should be around about there and try to clean your code up by making correct indentaions as its easyer to read.