14.10.2018, 09:45
OnPlayerCommandText will be called when player enters text what starts with /
OnPlayerText will be called when player enters text what start with somthing else.
OnPlayerText will be called when player enters text what start with somthing else.
PHP Code:
public OnPlayerText(playerid,text[]){
new len,tempText[128];
if((text[0]=='@' || text[0]=='7') && (len=strlen(text)) >= 2 ){
for(new i=1; i < len; i++){
if(!('a'<=text[i]<='z') && i < 4)return 0;
if(text[i]==' ')break;
tempText[i]=text[i];
}
if(PC_CommandExists(tempText)) text[0]='/',PC_EmulateCommand(playerid,text);
}
return 0;
}