02.06.2015, 13:24
Quote:
Try this:
Код:
#if !defined isnull #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1])))) #endif CMD:vchat(playerid,params[]){ if(!V[playerid][vlevel]) return EMess(playerid); if(isnull(params)) return SCM(playerid,-1,"Use:/vchat [Text]"); SendMessageToVips(playerid,params); return 1; } //Function here //i like javascript and use #define function%0(%1) forward%0(%1); .. function SendMessageToVips(id,const string[]){ var str[145]; GetPlayerName(id,str,MAX_PLAYER_NAME); format(str,sizeof(str),"{FFFF00}Vip Chat: %s say %s",str,string); for(var i; i<MAX_PLAYERS; i++){ if(!IsPlayerConnected(i) || !V[i][vlevel]) continue; SCM(i,-1,str); } return 1; } |
1)sorry I did not tell you about the var was my fault, yes i have #define var new for var variable why i like javascript .
2)this code is very good
Код:
#if !defined isnull #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1])))) #endif
Код:
function SendMessageToVips(id,string[]){ var name[MAX_PLAYER_NAME],str[256]; GetPlayerName(id,name,sizeof(name)); for(var i=0; i<MAX_PLAYERS; i++){ if(IsPlayerConnected(i)){ if(V[i][vlevel] > 0){ format(str,sizeof(str),"{FFFF00}Vip Chat: %s say %s",name,string); SCM(i,-1,str); } } } return 1; }