14.11.2013, 10:31
The Problem Is :
1-The Messages Even Warning 1 Or Warning 2 Or Warning 3 Doesn't Appear
================================================== ======
Helping With :
1-Long String
2-Long Reason
===========
Information : I Had Searched A Lot Then I Got This Command So Please :
1-Don't Give Me Links (Because I Read The Most Poplular Tutorials)
2-Don't Change Messages
3-And Test It To Find What's The Problem
4-Give Me Your Work But With Full My Code
================================
Please And Thanks
==============
Code :
1-The Messages Even Warning 1 Or Warning 2 Or Warning 3 Doesn't Appear
================================================== ======
Helping With :
1-Long String
2-Long Reason
===========
Information : I Had Searched A Lot Then I Got This Command So Please :
1-Don't Give Me Links (Because I Read The Most Poplular Tutorials)
2-Don't Change Messages
3-And Test It To Find What's The Problem
4-Give Me Your Work But With Full My Code
================================
Please And Thanks
==============
Code :
Quote:
CMD:warn(playerid, params[]) { new AdminName[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME], id, string[1000], Warnings[MAX_PLAYERS], Reason[100]; if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ ! ] Only Admins Can Be Use This Command [ ! ]"); if(sscanf(params, "us", id, Reason)) return SendClientMessage(playerid, 0xFFFF00FF, "Usage : /warn [Player-ID] [Reason]"); if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "[ ! ] Invalid-Player-ID [ ! ]"); if(id == playerid) return SendClientMessage(playerid, 0xFF0000FF, "[ ! ] You Can't Warn Your Self [ ! ]"); GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, PlayerName, sizeof(PlayerName)); If(Warnings[playerid] == 1) { format(string, sizeof(string), "{FFFF00}[ ! ] Player : %s (ID : %d) Has Been {FF0000}Warned {FFFF00}By {8000FF}Admin : %s (ID : %d) {FFFF00}Reason : %s Warnings : 1/3 [ ! ]", PlayerName, id, AdminName, playerid, Reason); SendClientMessageToAll(playerid, string); } If(Warnings[playerid] == 2) { format(string, sizeof(string), "{FFFF00}[ ! ] Player : %s (ID : %d) Has Been {FF0000}Warned {FFFF00}By {8000FF}Admin : %s (ID : %d) {FFFF00}Reason : %s Warnings : 2/3 [ ! ]", PlayerName, id, AdminName, playerid, Reason); SendClientMessageToAll(playerid, string); } If(Warnings[playerid] == 3) { format(string, sizeof(string), "{FFFF00}[ ! ] Player : %s (ID : %d) Has Been {FF0000}Kicked {FFFF00}By {8000FF}Admin : %s (ID : %d) {FFFF00}Reason : %s Warnings : 3/3 [ ! ]", PlayerName, id, AdminName, playerid, Reason); SendClientMessageToAll(playerid, strin); Kick(id); } for(new pid = 0; pid < MAX_PLAYERS; pid++) { PlayerPlaySound(pid, 1057, 0.0, 0.0, 0.0); } return 1; } |