03.10.2012, 06:34
What wrong with this code, when i use this cmd does not happen anything. Can anyone help me to fix this issues?
This is the code of /lvpddiv command
This is the code of /lvpddiv command
Код:
CMD:lvpddiv(playerid, params[]) { if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14 && PlayerInfo[playerid][pRank] >= 5) { new string[128], giveplayerid, division, type; if(sscanf(params, "ud", giveplayerid, division)) { SendClientMessageEx(playerid, COLOR_WHITE, "Gunakan: /lvpddiv [playerid] [divisi]"); SendClientMessageEx(playerid, COLOR_GRAD2, "Divisi: 1 (Tidak ada), 2 (II), 3 (FTO), 4 (IA), 5 (SWAT)"); return 1; } if (PlayerInfo[playerid][pRank] >= 5) { if(IsPlayerConnected(giveplayerid)) { if(PlayerInfo[playerid][pMember] == 1) { switch(type) { case 1: { PlayerInfo[giveplayerid][pDivisi] = 1; format(string, sizeof(string), "%s telah memberimu Divisi Polantas.", GetPlayerNameEx(playerid)); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Kamu telah memberikan Divisi Polantas kepada %s.", GetPlayerNameEx(giveplayerid)); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); } case 2: { PlayerInfo[giveplayerid][pDivisi] = 2; format(string, sizeof(string), "%s telah memberimu Divisi I.", GetPlayerNameEx(playerid)); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Kamu telah memberikan Divisi I kepada %s.", GetPlayerNameEx(giveplayerid)); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); } case 3: { PlayerInfo[giveplayerid][pDivisi] = 3; format(string, sizeof(string), "%s telah memberimu Divisi II.", GetPlayerNameEx(playerid)); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Kamu telah memberikan Divisi II kepada %s.", GetPlayerNameEx(giveplayerid)); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); } case 4: { PlayerInfo[giveplayerid][pDivisi] = 4; format(string, sizeof(string), "%s telah memberimu Divisi IA.", GetPlayerNameEx(playerid)); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Kamu telah memberikan Divisi IA kepada %s.", GetPlayerNameEx(giveplayerid)); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); } case 5: { PlayerInfo[giveplayerid][pDivisi] = 5; format(string, sizeof(string), "%s telah memberimu Divisi SWAT.", GetPlayerNameEx(playerid)); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Kamu telah memberikan Divisi SWAT kepada %s.", GetPlayerNameEx(giveplayerid)); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); } } } } } else { SendClientMessageEx(playerid, COLOR_GRAD1, "Kamu tidak dapat menggunakan perintah tersebut - minimal Rank 5 untuk menggunakan perintah itu."); } } return 1; }