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
return ( 1 );
CMD:setvip(playerid, params[])
{
if(pInfo[playerid][Level] >= 10 || IsPlayerAdmin(playerid))
{
new target, vip, string[124], pName[24];
if(sscanf(params, "ui", 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;
}
}
pInfo[playerid][Vip] == vip;
@Logitech90, it will give an error because you have set double '='.
Код:
pInfo[playerid][Vip] == vip; |
INI_WriteInt(PlayerFile,"Vip",pInfo[playerid][Vip]);
new INI:PlayerFile= INI_Open(PlayerPath(playerid));
new INI:PlayerFile= INI_Open(PlayerPath(playerid));
INI_WriteInt(PlayerFile,"Vip",pInfo[playerid][Vip]);
INI_Close(PlayerFile);