05.07.2012, 19:56
Hello! I have some problems with my scripts. Problems with variables and strings in callback OnDialogResponse. In top of callback I put this:
And I closed with bracket } in bottom of this callback. I put these codes:
And I have errors:
If I do like this:
Everything works right. What I need to do? I can't do anything Please help if u can I will be very grateful.
Код:
switch(dialogid) {
Код:
case 367: { if(response) { new sms[50],ZaidejoVardas[24]; if(sscanf(inputtext, "s[24]s[50]",ZaidejoVardas,sms)) return SendClientMessage(playerid, 0xFF0000AA, "Insert name and reason"); new Teis = StrFind(ZaidejoVardas);//StrFind is my own function. It finds player. if(Teis == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "We can't find this player.."); if(IsPlayerNPC(Teis)) return SendClientMessage(playerid, 0xFF0000AA, "We can't find this player."); new zigas[250]; format(zigas,sizeof(zigas),"Player name is %s, reason: %s",GetName(Teis),sms)//GetName is my own function. It returns player name. SendClientMessage(playerid,-1,zigas); } } case 368: { if(response) { new sms[50],ZaidejoVardas[24], laiks; if(sscanf(inputtext, "s[24]ds[50]",ZaidejoVardas,laiks,sms)) return SendClientMessage(playerid, 0xFF0000AA, "Insert name, time(seconds) and reason"); new Teis = StrFind(ZaidejoVardas);//StrFind is my own function. It finds player. if(Teis == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "We can't find this player.."); if(IsPlayerNPC(Teis)) return SendClientMessage(playerid, 0xFF0000AA, "We can't find this player."); new zigas[250]; format(zigas,sizeof(zigas),"You muted %s, for %d seconds, reason: %s",GetName(Teis),laiks,sms)//GetName is my own function. It returns player name. SendClientMessage(playerid,-1,zigas); } }
Код:
error 021: symbol already defined: "sms" error 021: symbol already defined: "Teis"
Код:
case 367: { if(response) { new sms[50],ZaidejoVardas[24]; if(sscanf(inputtext, "s[24]s[50]",ZaidejoVardas,sms)) return SendClientMessage(playerid, 0xFF0000AA, "Insert name and reason"); new Teis = StrFind(ZaidejoVardas);//StrFind is my own function. It finds player. if(Teis == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "We can't find this player.."); if(IsPlayerNPC(Teis)) return SendClientMessage(playerid, 0xFF0000AA, "We can't find this player."); new zigas[250]; format(zigas,sizeof(zigas),"Player name is %s, reason: %s",GetName(Teis),sms)//GetName is my own function. It returns player name. SendClientMessage(playerid,-1,zigas); } } /*case 368: { if(response) { new sms[50],ZaidejoVardas[24], laiks; if(sscanf(inputtext, "s[24]ds[50]",ZaidejoVardas,laiks,sms)) return SendClientMessage(playerid, 0xFF0000AA, "Insert name, time(seconds) and reason"); new Teis = StrFind(ZaidejoVardas);//StrFind is my own function. It finds player. if(Teis == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "We can't find this player.."); if(IsPlayerNPC(Teis)) return SendClientMessage(playerid, 0xFF0000AA, "We can't find this player."); new zigas[250]; format(zigas,sizeof(zigas),"You muted %s, for %d seconds, reason: %s",GetName(Teis),laiks,sms)//GetName is my own function. It returns player name. SendClientMessage(playerid,-1,zigas); } }*/