Raphy Posted February 5, 2012 Posted February 5, 2012 Am o problema cu comanda /setvip. Problema este ca playerii isi pot da singuri vip si nu stiu cum sa fac ca numai adminii sa deie vip. Va rog mult ajutatima mltumesc.
Raphy Posted February 5, 2012 Author Posted February 5, 2012 CMD:setvip( playerid , params[ ] ) { //CheckVipLevel(playerid, 5); if( sscanf( params , "ui", params[ 0 ], params[ 1 ] ) ) return SendClientMessage( playerid , 0xF60000AA , " Use /setvip [id] [level]" ); if( !IsPlayerConnected( params[ 0 ] ) ) return SendClientMessage( playerid , COLOR_RED , " Player not connected " ); new string[ 128 ]; switch( params[ 1 ] ) { case 0: { GetPlayerVip( params[ 0 ] ); SendClientMessage( params[ 0 ] , 0xF60000AA , " From now you are not V.I.P. anymore " ); } case 1..4: { SetPlayerVip( params[ 0 ], params[ 1 ] ); format( string, 128, " Player set as V.I.P Level %d", params[ 1 ] ); SendClientMessage( playerid , 0xF60000AA , string ); format( string, 128, " From now you are V.I.P. Level %d", params[ 1 ] ); SendClientMessage( params[ 0 ] , 0xF60000AA , string ); } default: return SendClientMessage( playerid , 0xF60000AA , " Use /setvip [id] [level]" ); } pVipInfo[ params[ 0 ] ][ DisableVipChat ] = 0; pVipInfo[ params[ 0 ] ][ IgnoreGoto ] = 0; pVipInfo[ params[ 0 ] ][ GodMode ] = 0; pVipInfo[ params[ 0 ] ][ SkinIDd ] = -1; return 1; }Aceasta este comanda
LTh_LeThaL Posted February 5, 2012 Posted February 5, 2012 Poftim;CMD:setvip( playerid , params[ ] ) { //CheckVipLevel(playerid, 5); if(PlayerInfo[playerid][pAdmin] > 1337) { if( sscanf( params , "ui", params[ 0 ], params[ 1 ] ) ) return SendClientMessage( playerid , 0xF60000AA , " Use /setvip [id] [level]" ); if( !IsPlayerConnected( params[ 0 ] ) ) return SendClientMessage( playerid , COLOR_RED , " Player not connected " ); new string[ 128 ]; switch( params[ 1 ] ) { case 0: { GetPlayerVip( params[ 0 ] ); SendClientMessage( params[ 0 ] , 0xF60000AA , " From now you are not V.I.P. anymore " ); } case 1..4: { SetPlayerVip( params[ 0 ], params[ 1 ] ); format( string, 128, " Player set as V.I.P Level %d", params[ 1 ] ); SendClientMessage( playerid , 0xF60000AA , string ); format( string, 128, " From now you are V.I.P. Level %d", params[ 1 ] ); SendClientMessage( params[ 0 ] , 0xF60000AA , string ); } default: return SendClientMessage( playerid , 0xF60000AA , " Use /setvip [id] [level]" ); } pVipInfo[ params[ 0 ] ][ DisableVipChat ] = 0; pVipInfo[ params[ 0 ] ][ IgnoreGoto ] = 0; pVipInfo[ params[ 0 ] ][ GodMode ] = 0; pVipInfo[ params[ 0 ] ][ SkinIDd ] = -1; else { SendClientMessage(playerid, COLOR_WHITE, "Ne pare rau, dar nu ai acces la aceasta Comanda."); } } return 1; } <a href="http://www.userbars.be"><img src="http://img534.imageshack.us/img534/9098/36589.gif" alt="Free userbars" border="0"></a>
Raphy Posted February 6, 2012 Author Posted February 6, 2012 Am bagat comanda si imi da urmatoarele erori:F:\SA-MP Server\gamemodes\bare.pwn(4907) : error 017: undefined symbol "pAdmin"F:\SA-MP Server\gamemodes\bare.pwn(4913) : warning 217: loose indentationF:\SA-MP Server\gamemodes\bare.pwn(4938) : warning 217: loose indentationF:\SA-MP Server\gamemodes\bare.pwn(4938) : error 029: invalid expression, assumed zeroF:\SA-MP Server\gamemodes\bare.pwn(4943) : warning 217: loose indentationLinia 4907: if(PlayerInfo[playerid][pAdmin] > 1337) Linia 4913: if( !IsPlayerConnected( params[ 0 ] ) ) Linia 4938: else Linia 4943: return 1;Te rog sa ma ajuti ca am incercat sa rezolv erorile dar nu am reusit.
Raphy Posted February 6, 2012 Author Posted February 6, 2012 Va rog frumos sa ma scuzati pentru dublu post dar ma ajuta cineva?
Gireada Posted February 6, 2012 Posted February 6, 2012 1.deci punemi o cmd de admin simpla.2.te duci la inceputul gm-ului dupa includere si pui #pragma tabsize 0
Raphy Posted February 6, 2012 Author Posted February 6, 2012 CMD:setwanted(playerid,params[]) { if(PlayerInfo[ playerid ][Level] >= 1) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setwanted [ playerid ] [level]"); new player1 = strval(tmp), wanted = strval(tmp2), string[128]; // if(wanted > 6) return SendClientMessage(playerid, red, "ERROR: Invaild wanted level"); if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[ playerid ][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin"); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { CMDMessageToAdmins(playerid,"SETWANTED"); format(string, sizeof(string), "You have set \"%s's\" wanted level to '%d", pName(player1), wanted); SendClientMessage(playerid,blue,string); if(player1 != playerid) { format(string,sizeof(string),"{0049FF}Administrator {F81414}\"%s\" {FFFFFF}has set your wanted level to {6EF83C}'%d'", pName(playerid), wanted); SendClientMessage(player1,blue,string); } return SetPlayerWantedLevel(player1, wanted); } else return SendClientMessage(playerid,red,"ERROR: Player is not connected"); } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); }O comanda de admin simpla si am pus #pragma tabsize 0 la inceput si nu imi mai da acele warning imi da numai acele 2 erori.
TzAkS Posted February 6, 2012 Posted February 6, 2012 Pai nu ai funcita pAdmin pentru admini..cauta la o comanda care numai un admin o poate folosii si vezi ce e in loc de pAdmin si la cealalta eroare da`mi si liniile de mai in sus.
Raphy Posted February 6, 2012 Author Posted February 6, 2012 Am rezolvat mersi mult pentru ajutor poti inchide topicul
Question
Raphy
Am o problema cu comanda /setvip. Problema este ca playerii isi pot da singuri vip si nu stiu cum sa fac ca numai adminii sa deie vip. Va rog mult ajutatima mltumesc.
9 answers to this question
Recommended Posts