21.02.2014, 17:13
(
Последний раз редактировалось Pakistanboy321; 21.02.2014 в 17:16.
Причина: want to add more
)
whenever i write it in-game /report it always show me twice this command /report (playerid) (reason)
this also whenever i write /setvip it shows me the message twice /setvip (id) (level)
Код:
CMD:report(playerid, params[]) { if(pInfo[playerid][pLogged] == 1) { new text[128],targetid,string[128],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME]; if(sscanf(params, "us[128]", targetid, text)) SendClientMessage(playerid, COLOR_GREY, "Usage: /report [playerid] [reason]"); else { if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Invaild ID - That player is not connected!"); format(sendername, sizeof(sendername), "%s", PlayerName(playerid)); format(giveplayer, sizeof(giveplayer), "%s", PlayerName(targetid)); format(string, sizeof(string), "Report: %s[%d] has reported %s[%d] [Reason: %s]", sendername, playerid, giveplayer, targetid, text); SendMessageToAdmins(COLOR_YELLOW,string); printf("Report: %s[%d] has reported %s[%d] [Reason: %s]", sendername, playerid, giveplayer, targetid, text); SendClientMessage(playerid, COLOR_GREEN,"Thanks for reporting!"); } } else if(pInfo[playerid][pLogged] == 0) { SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Nice try u fucking fag gay!"); printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid)); Kick(playerid); } return 1; }
Код:
CMD:setvip(playerid,params[]) { if(pInfo[playerid][pLogged] == 1) { if(pInfo[playerid][pAdminLevel] >= 6) { new targetid,level,string[256]; if(sscanf(params, "ud", targetid, level)) return SendClientMessage(playerid,-1,""chat" /setdonor [playerid] [level]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online"); if(level < 0 || level > 5) return SendClientMessage(playerid,-1,""chat" Vip levels are ONLY between 1-5"); pInfo[targetid][pVipLevel] = level; format(string, sizeof(string), ""chat""COL_LIGHTBLUE" %s %s have given vip status of %d to %s",GetAdminName(playerid),PlayerName(playerid),level,PlayerName(targetid)); SendClientMessageToAll(-1,string); printf(" %s %s have given vip status of %d to %s",GetAdminName(playerid),PlayerName(playerid),level,PlayerName(targetid)); } else { SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" You do not have the right admin permissions for this command!"); } } else if(pInfo[playerid][pLogged] == 0) { SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Nice try u fucking fag gay!"); printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid)); Kick(playerid); } return 1; }