23.07.2011, 05:16
Quote:
Well for one thing that color doesn't look very valid, -1? What color are you intending it to be? It should be in hex format, but all I see is a negative integer, which seems a little odd, I don't know what kind of results that would turn up, but I would suggest using the function as it's intended to be used!
Anyway, I'm pretty sure it'll do something if it's called, so lets add some prints to debug it like I stated earlier, I'll help you add them: pawn Код:
|
pawn Код:
dcmd_report(playerid, params[])
{
new target, msg[128], tString[128];
if(sscanf(params, "us[128]", target, msg)) return SendClientMessage(playerid, -1, "How to report: /report [admin name] [message]");
if(JustReported[playerid] == 1) return SendClientMessage(playerid, -1, "You must wait 10 seconds to report again!");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "That Admin is not online!");
if(PlayerInfo[target][pAdmin] <=1) return SendClientMessage(playerid, -1, "That person is not an Admin!");
//If all above checks out, the code below will execute
JustReported[playerid] = 1;
SetTimerEx("ReportReset", 10000, false, "i", playerid);
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(tString, sizeof(tString), "{CC1100}Report from {FFFFFF}[%d]%s: %s", playerid, sendername, msg);
SendClientMessage(target,-1,tString);
SendClientMessage(playerid, COLOR_YELLOW, "Report sent. Administrator will reply shortly.");
return 1;
}
dcmd_robbank(playerid, params[])
{
print("Success 1");
if(PlayerInfo[playerid][pLevel] < 2) return SendClientMessage(playerid, COLOR_WHITE, "You need to be at least Level 3!");
print("Success 2");
if(!IsPlayerInRangeOfPoint(playerid, 2, 345.585968, 112.513107, 1008.184448) return SendClientMessage(playerid, COLOR_WHITE, "You're not at the Robbing Point!");
print("Success 3");
if(IsACop(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Cops cannot rob the bank!");
new Cops = 0;
print("Success 4");
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsACop(i)) Cops += 1;
print("Success 5");
if(!(Cops >= 2))
{
SendClientMessage(playerid,COLOR_GREY,"There must be at least 2 Law Enforcement Officials online.");
return 1;
}
print("Success 6");
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessageToAll(COLOR_LIGHTBLUE, "The Los Santos City bank is being robbed!");
return 1;
}