08.11.2012, 19:14
Here is the command:
It saves at players disconnect:
And on a player file it appear there if it has or no V.I.P:
But, it doesn't saves...i setvip to x, it reconnects and the vip isn't...
Код:
CMD:setvip( playerid, params[] ) { if( pInfo[ playerid ][ Level ] >= 10 || IsPlayerAdmin( playerid )) { new target, vip, string[124], pName[24]; if( sscanf( params, "ud", target, vip )) return SCM( playerid, C_RED, "USAGE: /setvip [ playerid ] [ level ]"); if( !IsPlayerConnected( target )) return SCM( playerid, C_RED, "[ERROR]: {FFFFFF}Player not connected."); if( vip < 0 || vip > 4 ) return SCM( playerid, C_RED, "ERROR:Invalid level. (1-4)"); GetPlayerName( target, pName, sizeof( pName )); format( string, sizeof( string ), "%s has been promoted to a vip level %d !", pName, vip); SCMToAll( C_WHITE, string); pInfo[ playerid ][ Vip ] = vip; return ( 1 ); } else return SCM( playerid, C_RED, "[ERROR]: {FFFFFF}You need to be a higher level to use this command !"); }
Код:
INI_WriteInt( PlayerFile, "Vip", pInfo[ playerid ][ Vip ]);
Код:
Vip = 3