11.06.2012, 20:40
i have one doubt! who's the best? repeat command or use OnPlayerCommandText
example:
and now, for example, in OnPlayerKeyStateChange. who's the best? write the /command again
like this
or use OnPlayerCommandText ?
like this
example:
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp(cmdtext,"/command",true))
{
//command...
}
return 0;
}
like this
pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
if(PRESSED(KEY_FIRE))
{
//command...
}
return 1;
}
like this
pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
if(PRESSED(KEY_FIRE))
{
OnPlayerCommandText(playerid,"/command");
}
return 1;
}