13.06.2012, 12:28
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 ;)
}
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 ;)
}