28.01.2010, 00:51
Hey i want to take data from command for example.. if i use /call 911.. i want take "911" if i use /said helloooo ... i want to take "helloooo" how i can do that?
Originally Posted by Seif_
With a variable.
|
Originally Posted by [HiC
TheKiller ]
Quote:
Anyway, use DCMD and take the Params. |
dcmd_call(playerid, params[])
{
new
pn, // phonenumber
string[1]; // you'll need it later
if(sscanf(params, "d", pn)) // d is the type of variable and pn is where we're going to store the value in params
{
SendClientMessage(playerid, COLOR, "Correct usage: /call [phone number]");
return 1;
}
else if(pn == 911)
{
// call 911 stuff
}
else
{
// call any phone number
}
return 1;
}
Originally Posted by SAWC™
Use dcmd + sscanf and here's an example:
pawn Код:
|