Problem with variables in switch/case
#4

Try this code.

pawn Код:
case 367:
{
    if(response)
    {
        new sms[50],ZaidejoVardas[24], Teis = StrFind(ZaidejoVardas);
        if(sscanf(inputtext, "s[24]s[50]",ZaidejoVardas,sms)) return SendClientMessage(playerid, 0xFF0000AA, "Insert name and reason");
        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 ZaidejoVardas[24], laiks;
        if(sscanf(inputtext, "s[24]ds[50]",ZaidejoVardas,laiks,sms)) return SendClientMessage(playerid, 0xFF0000AA, "Insert name, time(seconds) and reason");
        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);
    }
}
Reply


Messages In This Thread
Problem with variables in switch/case - by Vvolk - 05.07.2012, 19:56
Re: Problem with variables in switch/case - by Steven82 - 05.07.2012, 19:59
Re: Problem with variables in switch/case - by Vvolk - 05.07.2012, 20:00
Re: Problem with variables in switch/case - by Steven82 - 05.07.2012, 20:07
Re: Problem with variables in switch/case - by Vvolk - 05.07.2012, 20:11

Forum Jump:


Users browsing this thread: 1 Guest(s)