DCMD using more than one param?
#2

pawn Код:
dcmd_example(playerid, params[])
{
//now to make more then 1 params is simple, the easiest way is like this
new otherplayerid = params[0];//the id of the target player
new something = params[1];//variable for something i dont know its an example ;)
new text[250] = params[2];//string for player to type text etc.

//then later on you just use them like this
new str[128];format(str,sizeof(str),"player ID Selected %d, Something: %d, the text: %s",otherplayerid,something,text);
//and thats how you use them ;)
}
there is a sceond way
is the same thing but saves lines
pawn Код:
dcmd_example(playerid, params[])
{
//you dont have to add the new playerid, etc...

new str[128];format(str,sizeof(str),"player ID Selected %d, Something: %d, the text: %s",params[0],params[1],params[2]);
//and thats how you use them ;)
}
Reply


Messages In This Thread
DCMD using more than one param? - by Mikibey - 13.06.2012, 11:29
Re: DCMD using more than one param? - by park4bmx - 13.06.2012, 12:28
Re: DCMD using more than one param? - by Mikibey - 13.06.2012, 13:00
Re: DCMD using more than one param? - by park4bmx - 13.06.2012, 13:25
Re: DCMD using more than one param? - by eSPeZet - 01.08.2017, 17:45
Re: DCMD using more than one param? - by eSPeZet - 02.08.2017, 17:19

Forum Jump:


Users browsing this thread: 1 Guest(s)