09.01.2018, 20:57
Hello there,
( i am a beginner in this )
Sorry if i mistake at forum thread or something...
i have one problem in my script. I make a command to punish someone with jail and similar things. I did it in way where an administrator must revise her parameters. Here is a code:
But when i response this dialog nothing happend, i don't know where is problem. If you can help me, i will rep it. Thanks forward.
Here is a response of dialog: (( don't look at size of code, that is not so important, look at // commented parts. ))
( i am a beginner in this )
Sorry if i mistake at forum thread or something...
i have one problem in my script. I make a command to punish someone with jail and similar things. I did it in way where an administrator must revise her parameters. Here is a code:
Code:
CMD:kazniigraca( playerid, params[] ) { if( PlayerInfo[ playerid ][ xAdmin ] >= 1 ) { if( !AdminDuty[ playerid ] ) return GRESKA( playerid, "Da bi koristili ovu komandu morate biti Admin na duznosti" ); new id,reason,string[200]; if( sscanf(params, "ui", id, reason ) ) { SendUsageMessage( playerid, "/kazniigraca [ ID/Deo imena ] [ Broj razloga ]"); SendUsageMessage( playerid, "1 DM | 2 SK | 3 RK | 4 PG | 5 MG | 6 DB | 7 NJ | 8 PvP" ); SendUsageMessage( playerid, "9 KOS | 10 TK | 11 Vredjanje | 12 Ometanje Radnika" ); SendUsageMessage( playerid, "13 Prevara | 14 Invalid /ad | 15 CR | 16 PvE" ); return 1; } if( id == IPI ) return GRESKA( playerid, "Uneli ste pogresan ID igraca." ); if(reason > 1 && reason < 16) // type of punishment { new kazna[35]; Idkazne[playerid] = reason; // this is variable to save a number of punishment for proceeding agreement Idkaznenog[playerid] = id; // save a ID of player who is punish by administrator switch(reason) { case 1: kazna = "DeathMatch(DM)"; case 2: kazna = "SpawnKill(SK)"; case 3: kazna = "RevengeKill(RK)"; case 4: kazna = "PowerGaming(PG)"; case 5: kazna = "MetaGaming(MG)"; case 6: kazna = "Drive-by(DB)"; case 7: kazna = "NinjaJacking"; case 8: kazna = "PlayerVsPlayer(PvP)"; case 9: kazna = "KillOnSight(KOS)"; case 10: kazna = "TeamKill(TK)"; case 11: kazna = "Vredjanje"; case 12: kazna = "Ometanje Radnika"; case 13: kazna = "Prevara"; case 14: kazna = "Invalid advertise"; case 15: kazna = "ChickenRun(CK)"; case 16: kazna = "PlayerVsEnviroment(PvE)"; } format(string,sizeof(string),"(CHECK)\n\nDa li ћelite da izvrљite radnju sa navedenim paramterima?\n\nIgrac: %s (%d)\nKazna: %s (Broj: %d)\n\n(CHECK)",ImeIgraca(playerid),playerid,kazna,reason); SPD(playerid,dialog_PROVERAKAZNE,DIALOG_STYLE_MSGBOX,""col_sanm"PROVJERA KAZNE",string,"Da","Ne"); return 1; } else { GRESKA(playerid,"Doslo je do greљke ponovite radnju!"); } } else return GRESKA( playerid, "Niste u mogucnosti koristiti ovu komandu." ); return 1; }
Here is a response of dialog: (( don't look at size of code, that is not so important, look at // commented parts. ))
Code:
else if( dialogid == dialog_PROVERAKAZNE) { if(!response) { Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; SendInfoMessage(playerid,"Odustali ste od kazne."); } if(response) { new reason, id; Idkazne[playerid] = reason; // this is place where i use a variable of player( number of punishment) Idkaznenog[playerid] = id; // number of punishmented player if( reason == 1 ) { JailPlayer( id, 60 ); DajIgracuNovac( id, -5000 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"DM." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"60 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"5000$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: DM.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 2 ) { JailPlayer( id, 30 ); DajIgracuNovac( id, -2500 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"SK." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"30 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"2500$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: SK.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 3 ) { JailPlayer( id, 30 ); DajIgracuNovac( id, -2500 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"RK." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"30 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"2500$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: RK.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 4 ) { JailPlayer( id, 30 ); DajIgracuNovac( id, -3000 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"PG." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"30 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"3000$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: PG.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 5 ) { JailPlayer( id, 10 ); DajIgracuNovac( id, -500 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"MG." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"10 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"500$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: MG.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 6 ) { JailPlayer( id, 45 ); DajIgracuNovac( id, -3500 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"DB." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"45 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"3500$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: DB.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 7 ) { JailPlayer( id, 30 ); DajIgracuNovac( id, -2500 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"NJ." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"30 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"2500$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: NJ.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 8 ) { JailPlayer( id, 30 ); DajIgracuNovac( id, -2500 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"PvP." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"30 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"2500$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: PvP.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 9 ) { JailPlayer( id, 30 ); DajIgracuNovac( id, -2500 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"KOS." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"30 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"2500$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: KOS.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 10 ) { JailPlayer( id, 45 ); DajIgracuNovac( id, -3000 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"TK." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"45 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"3000$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: TK.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 11 ) { JailPlayer( id, 60 ); DajIgracuNovac( id, -5000 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"Vredjanje." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"60 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"5000$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: Vredjanje.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 12 ) { JailPlayer( id, 45 ); DajIgracuNovac( id, -3000 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"Ometanje radnika." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"45 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"3000$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: Ometanje radnika.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 13 ) { JailPlayer( id, 600 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"Prevara." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"600 minuta." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: Prevara.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 14 ) { JailPlayer( id, 15 ); DajIgracuNovac( id, -500 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"Invalid /ad." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"15 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"500$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: Invalid /ad.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 15 ) { JailPlayer( id, 30 ); DajIgracuNovac( id, -2000 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"CR." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"30 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"2000$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: CR.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } else if( reason == 16 ) { JailPlayer( id, 30 ); DajIgracuNovac( id, -2000 ); SendClientMessage( id, ANTICHEAT, "________________________________________"); SendClientMessageEx( id, -1, ""col_white"Admin vas je kaznio." ); SendClientMessageEx( id, -1, ""col_white"Razlog kazne: "col_extreme"PvE." ); SendClientMessageEx( id, -1, ""col_white"Dobili ste zatvor od "col_extreme"30 minuta." ); SendClientMessageEx( id, -1, ""col_white"Oduzeto vam je "col_extreme"2000$." ); SendClientMessage( id, ANTICHEAT, "________________________________________"); format( globalstring, sizeof( globalstring ), "KAZNA | Admin je kaznio igraca %s. Razlog: PvE.", ImeIgraca( id ) ); SCMA( NARACRVENA, globalstring ); Idkazne[playerid] = -1; Idkaznenog[playerid] = -1; } } }