SA-MP Forums Archive
Problem with my code it doesn't display the reason !!!!! [FIXED] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with my code it doesn't display the reason !!!!! [FIXED] (/showthread.php?tid=145155)



Problem with my code it doesn't display the reason !!!!! [FIXED] - Micko9 - 01.05.2010

ok sooo im really confused now
code :

pawn Код:
dcmd_stopvote(playerid,params[])
{
    new reason[128], str[50];
    if (!strlen(params))
    {
      Vote[InProgress]=false;
      Vote[Votes]=0;
      for (new i=0; i<MAX_PLAYERS+1; i++) if (IsPlayerConnected(i)) Voted[i]=0;
        format(str,sizeof(str),"The Vote Has Been Stoped By %s .",PlayerName(playerid));
        SendClientMessageToAll(yellow,str);
    }
    else
    {
      sscanf(params,"s",reason);
        Vote[InProgress]=false;
      Vote[Votes]=0;
      for (new i=0; i<MAX_PLAYERS+1; i++) if (IsPlayerConnected(i)) Voted[i]=0;
        format(str,sizeof(str),"The Vote Has Been Stoped By %s . Reason : %s",PlayerName(playerid),reason);
        SendClientMessageToAll(yellow,str);
    }
    return true;
}
it just displays when i typed /votestop test :
"The Vote Has Been Stoped By Micko9 . Reason :"
and empty
nothing at reason!

i tryed also

Код:
reason=strval(params);


Edit : Fixed $.$ the str size was too short...what a lol reason lol

Fixed! Thanks for reading