SA-MP Forums Archive
Text in params of DCMD - 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: Text in params of DCMD (/showthread.php?tid=242575)



Text in params of DCMD - Ihsan-Cingisiz - 20.03.2011

Hello,

I got a question. How can you let the params[] in dcmd know and save
a text into it? I want to do something like this:

Код:
dcmd(playerid, params[])
{
     if(strlen(params) == 0)
     {
          SendClientMessage(...
          return 1;
     }
     
     if(params[0] == "blabla")
     {
          PlayerInfo[playerid][blabla] = 1;
     }
     else if(params[0] == "bladibladibla")
     {
          PlayerInfo[playerid][bladibladibla] = 2;
     }
     return 1;
}
How can I use this in the right way?

Thanks.


Re: Text in params of DCMD - JamesC - 20.03.2011

pawn Код:
if(!strcmp(params,"blabla", true))
{
    PlayerInfo[playerid][blabla] = 1;
}



Re: Text in params of DCMD - Ihsan-Cingisiz - 20.03.2011

Quote:
Originally Posted by JamesC
Посмотреть сообщение
pawn Код:
if(!strcmp(params,"blabla", true))
{
    PlayerInfo[playerid][blabla] = 1;
}
Thanks you!