28.01.2011, 02:02
What am i doing wrong? It crashes my sevrer :S
pawn Код:
dcmd_report(playerid, params[])
{
new targetid, reason;
if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_USAGE, "bla bla");
else if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "bla bla");
//else if(playerid == targetid) return SendClientMessage(playerid, COLOR_ERROR, "bla bla");
{
new playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(targetid, targetname, sizeof(targetname));
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && IsPlayerAdmin(i))
{
SendClientMessage(playerid, COLOR_ADMIN, "bla bla");
format(string, sizeof(string), "bla bla",playername, playerid, targetname, targetid, reason);
SendClientMessageToAll(0xFF0000FF, string);
return 1;
}
}
return 1;
}
}
pawn Код:
dcmd_ask(playerid, params[])
{
new question;
if(sscanf(params, "z", question)) return SendClientMessage(playerid, COLOR_USAGE, "bla bla");
{
new playername[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, playername, sizeof(playername));
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && IsPlayerAdmin(i))
{
SendClientMessage(playerid, COLOR_ADMIN, "bla bla");
format(string, sizeof(string), "bla bla",playername, playerid, question);
SendClientMessage(i, COLOR_ADMIN, string);
return 1;
}
}
return 1;
}
}