10.05.2009, 20:59
Hello.
Help me please ( i am junior in pawno )
Explain how to use the stock
Examples of please..
Help me please ( i am junior in pawno )
Explain how to use the stock
Examples of please..
stock ReturnPlayerID(playerid)
{
return playerid;
}
stock playerid(playerid)
return playerid;
//or
player(playerid)
return playerid;
Originally Posted by MenaceX^
stock is a function, it can have "stock" infront of the function's name and it can to not have it.
pawn Код:
|
stock GivePlayerHealth(playerid, Float:health)
{
new Float:pHealth;
GetPlayerHealth(playerid, pHealth);
SetPlayerHealth(playerid, pHealth + health);
}
///command.
format(string,sizeof(string),"SELECT * FROM `table` WHERE name='%s'",randomname);
samp_mysql_query(string);
samp_mysql_store_result(); // etc etc.
///command
if(CheckPlayerExistant(variable))
{
//code
//code
//code
}
else return SendClientMessage(playerid,color,"player does not exists");
Originally Posted by Buttig
So for example, see:
pawn Код:
|
if(!strcmp(cmdtext,"/givehealth",true))
return GiveHealth(playerid,50);
Originally Posted by Weirdosport
|