COMMAND:request(playerid, params[]) { new id; if(sscanf(params,"i", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /request [orgid]"); 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,MAX_PLAYERS,"* %s is requesting to join San Andreas Police Dept.",Name); SendClientMessageToAll(SAPD_COLOR,String); IsRequesting[playerid] = 1; request[playerid] = 1; return 1; } if(id == 2) { format(String,MAX_PLAYERS,"* %s is requesting to join San Andreas Street Racers.",Name); SendClientMessageToAll(SASR_COLOR,String); IsRequesting[playerid] = 1; request[playerid] = 2; return 1; } if(id == 3) { format(String,MAX_PLAYERS,"* %s is requesting to join Hitmen.",Name); SendClientMessageToAll(HITMAN_COLOR,String); IsRequesting[playerid] = 1; request[playerid] = 2; return 1; } if(id == 4) { format(String,MAX_PLAYERS,"* %s is requesting to join The National Guard.",Name); SendClientMessageToAll(NG_COLOR,String); IsRequesting[playerid] = 1; request[playerid] = 2; return 1; } return 1; } |
C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(82) : warning 217: loose indentation C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(90) : warning 217: loose indentation C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(99) : warning 217: loose indentation C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(145) : warning 217: loose indentation C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(183) : warning 217: loose indentation C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(259) : warning 219: local variable "id" shadows a variable at a preceding level C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(290) : warning 225: unreachable code C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(290) : warning 217: loose indentation C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(290) : error 029: invalid expression, assumed zero C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(290) : error 017: undefined symbol "cmd_request" C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(290) : error 029: invalid expression, assumed zero C:\Documents and Settings\gamer\Desktop\MW-DM\filterscripts\Orgs.pwn(290) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
COMMAND:request(playerid, params[])
{
new fid;
if(sscanf(params,"i ", fid))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /request [orgid]");
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!");
switch(fid)
{
case 1:
{
format(String,MAX_PLAYERS,"* %s is requesting to join San Andreas Police Dept.",Name);
SendClientMessageToAll(SAPD_COLOR,String);
IsRequesting[playerid] = 1;
request[playerid] = 1;
return 1;
}
case 2:
{
format(String,MAX_PLAYERS,"* %s is requesting to join San Andreas Street Racers.",Name);
SendClientMessageToAll(SASR_COLOR,String);
IsRequesting[playerid] = 1;
request[playerid] = 2;
return 1;
}
case 3:
{
format(String,MAX_PLAYERS,"* %s is requesting to join Hitmen.",Name);
SendClientMessageToAll(HITMAN_COLOR,String);
IsRequesting[playerid] = 1;
request[playerid] = 2; // I believe this should be 3?
return 1;
}
case 4:
{
format(String,MAX_PLAYERS,"* %s is requesting to join The National Guard.",Name);
SendClientMessageToAll(NG_COLOR,String);
IsRequesting[playerid] = 1;
request[playerid] = 2; // and this 4 maybe?
return 1;
}
}
return 1;
}
COMMAND:request(playerid, params[])
{
new fid;
if(sscanf(params,"i ", fid))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /request [orgid]");
GetPlayerName(playerid, Name, sizeof(Name));
if(IsInOrg[playerid] == 1) return SendClientMessage(playerid, red," You are already in a organisation!");
if(request[playerid] > 0) return SendClientMessage(playerid, red," You are already requesting to join an organisation!");
if(fid < 1 || fid > 4) return SendClientMessage(playerid, red, " Invalid organisation id, must be between 1-4!");
switch(fid)
{
case 1:
{
format(String,MAX_PLAYERS,"* %s is requesting to join San Andreas Police Dept.",Name);
SendClientMessageToAll(SAPD_COLOR,String);
}
case 2:
{
format(String,MAX_PLAYERS,"* %s is requesting to join San Andreas Street Racers.",Name);
SendClientMessageToAll(SASR_COLOR,String);
}
case 3:
{
format(String,MAX_PLAYERS,"* %s is requesting to join Hitmen.",Name);
SendClientMessageToAll(HITMAN_COLOR,String);
}
case 4:
{
format(String,MAX_PLAYERS,"* %s is requesting to join The National Guard.",Name);
SendClientMessageToAll(NG_COLOR,String);
}
}
request[playerid] = fid;
return 1;
}