Text in params of DCMD
#1

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.
Reply
#2

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)