new OfferAiuto[MAX_PLAYERS]; new OfferAiutante[MAX_PLAYERS];
OfferAiuto[playerid] = 999; OfferAiutante[playerid] = 999;
if(strcmp(cmd, "/preputation", true) == 0 || strcmp(cmd, "/pr", true) == 0) { if(IsPlayerConnected(playerid)) { if(AltroServer[playerid] != 0) return 1; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, GIALLO, "(Utilizzo):{FFFFFF} /pr [playerid/partofname]"); return 1; } new plo; new string2[256]; plo = ReturnUser(tmp); if(IsPlayerConnected(plo)) { if(plo != INVALID_PLAYER_ID) { if(AdminDuty[playerid] && PlayerInfo[playerid][pAdmin] >= 1) { format(string, sizeof(string), "(Info:){FFFFFF} You have sent the request to : %s", GetPlayerNameEx(plo)); SendClientMessage(playerid, VERDE_CHIARO,string); //=============================// format(string2, sizeof(string2), "(Info:){FFFFFF} The Administator %s asked you to evaluate his work", GetPlayerNameEx(playerid)); SendClientMessage(plo, VERDE_CHIARO,string2); ShowPlayerDialog(plo, DIALOG_OPERATO, DIALOG_STYLE_INPUT, " {FF8200}Value", "\n How useful was the admin? Insert a value for his work.\n A value from 1 to 10", "Ok", ""); OfferAiuto[plo] = plo; OfferAiutante[playerid] = playerid; } else { SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} Non sei autorizzato a utilizzare questo comando o non sei AdminDuty."); } } } else { SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} ID/Nome invalido"); } } return 1; }
//DIALOGRESPONSE if(dialogid == DIALOG_OPERATO) { if(response) { new string3[256]; new input = strval(inputtext); if(input > 0 && input <= 10) { GetPlayerName(OfferAiutante[playerid], playerid, sizeof(playerid)); format(string3, sizeof(string3), "(Admin Chat): %s has been valuted by {FFAF00} : %s with the vote %d/10",GetPlayerNameEx(OfferAiutante[playerid]),GetPlayerNameEx(OfferAiuto[playerid]),input); AdministratorMessage(0x00FF0000, string3,1); OfferAiuto[playerid] = 999; OfferAiutante[playerid] = 999; SetAdminLog(string3); } else { ShowPlayerDialog(playerid, DIALOG_OPERATO, DIALOG_STYLE_INPUT, " {FF8200}Competence", "\n Insert the competence of the admin.\n Insert a value from 1 to 10", "Ok", "");// This is a comment SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} A value from 1 to 10"); return 1; } } }
format(string3, sizeof(string3), "(Admin Chat): %s has been valuted by {FFAF00} : %s with the vote %d/10",GetPlayerNameEx(OfferAiutante[playerid]),GetPlayerNameEx(OfferAiuto[playerid]),input);
new OfferAiutante[MAX_PLAYERS];
OfferAiutante[playerid]=INVALID_PLAYER_ID;
if(strcmp(cmd, "/preputation", true) == 0 || strcmp(cmd, "/pr", true) == 0) { if(AltroServer[playerid] != 0) return 1; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, GIALLO, "(Utilizzo):{FFFFFF} /pr [playerid/partofname]"); new plo; new string2[256]; plo = ReturnUser(tmp); if(IsPlayerConnected(plo)) { if(plo != playerid) { if(AdminDuty[playerid] && PlayerInfo[playerid][pAdmin] >= 1) { format(string, sizeof(string), "(Info:){FFFFFF} You have sent the request to : %s", GetPlayerNameEx(plo)); SendClientMessage(playerid, VERDE_CHIARO,string); //=============================// format(string2, sizeof(string2), "(Info:){FFFFFF} The Administator %s asked you to evaluate his work", GetPlayerNameEx(playerid)); SendClientMessage(plo, VERDE_CHIARO,string2); ShowPlayerDialog(plo, DIALOG_OPERATO, DIALOG_STYLE_INPUT, " {FF8200}Value", "\n How useful was the admin? Insert a value for his work.\n A value from 1 to 10", "Ok", ""); OfferAiutante[plo] = playerid; } else { SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} Non sei autorizzato a utilizzare questo comando o non sei AdminDuty."); } } else { SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} Cannot rate yourself!"); } } else { SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} ID/Nome invalido"); } return 1; }
if(dialogid == DIALOG_OPERATO) { new string3[256]; if(response) { new input = strval(inputtext); if(0 < input < 11) { format(string3, sizeof(string3), "(Admin Chat): %s has been valuted by {FFAF00} : %s with the vote %d/10",GetPlayerNameEx(OfferAiutante[playerid]),GetPlayerNameEx(playerid),input); AdministratorMessage(0x00FF0000, string3,1); OfferAiutante[playerid] = INVALID_PLAYER_ID; SetAdminLog(string3); } else { ShowPlayerDialog(playerid, DIALOG_OPERATO, DIALOG_STYLE_INPUT, " {FF8200}Competence", "\n Insert the competence of the admin.\n Insert a value from 1 to 10", "Ok", "");// This is a comment SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} A value from 1 to 10"); return 1; } } else // There is a chance that the player might hit the ESC button in order to cancel the dialog, so you wanna have this too. { format(string,sizeof(string)," %s has canceled your rate.",GetPlayerNameEx(playerid)); SendClientMessage(OfferAiutante[playerid],ROSSO_CHIARO,string); OfferAiutante[playerid] = INVALID_PLAYER_ID; } }
Yes i know it was my choise using just onplayercommandtext
btw you are beast, thank you . ill rep ++ |