Gold rims help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Gold rims help (
/showthread.php?tid=348638)
Gold rims help -
Josh_Main - 06.06.2012
Hello, i got this code for gold rims, but anyone can use it. How can i make it so only admins can use it? ive tried if(IsPlayerAdmin(playerid) and it doesnt work. Heres the code:
Код HTML:
#define FILTERSCRIPT
#include <a_samp> // Credits To SA-MP Team (:
#include <zcmd> // Credits To Zeex (:
new WTimer1;
new WTimer2;
new WTimer3;
new WTimer4;
new WTimer5;
new WTimer6;
new WTimer7;
forward Wheel1(playerid);
forward Wheel2(playerid);
forward Wheel3(playerid);
forward Wheel4(playerid);
forward Wheel5(playerid);
forward Wheel6(playerid);
forward Wheel7(playerid);
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_TWWHITE 0xFFFFFFAA
#define COLOR_GREY 0xAFAFAFAA
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("---------Simon Gold rims loaded---------");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
KillTimer(WTimer1);
KillTimer(WTimer2);
KillTimer(WTimer3);
KillTimer(WTimer4);
KillTimer(WTimer5);
KillTimer(WTimer6);
KillTimer(WTimer7);
return 1;
}
#else
main()
{
print("\n----------------------------------");
print("Simon Gold rims unloaded");
print("----------------------------------\n");
}
#endif
public OnPlayerConnect(playerid)
{
/*If You can Remove Credits if you want.
Simon Gold rims system, Thankx*/
return 1;
}
public Wheel1(playerid)
{
KillTimer(WTimer1);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
COMMAND:goldrim(playerid,params[])
{
if(IsPlayerAdmin(playerid) >= 1337) {
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
}
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_TWWHITE, "You Successfully Turned normal rims to gold rims!");
SendClientMessage(playerid, COLOR_TWWHITE, "Thanks for using Gold Rims system by Simon.");
KillTimer(WTimer2);
KillTimer(WTimer3);
KillTimer(WTimer4);
KillTimer(WTimer5);
KillTimer(WTimer6);
KillTimer(WTimer7);
WTimer1 = SetTimerEx("Wheel1", 600, 0, "d" ,playerid);
}
else
{
SendClientMessage(playerid, COLOR_TWWHITE, "You Must Be Inside A Vehicle To Use This Command!");
}
return 1;
}
Please help, thanks in advance.
Re: Gold rims help -
Infinity90 - 06.06.2012
Are you wanting it for a admin Rank? or Rcon admin?
AW: Gold rims help -
Josh_Main - 06.06.2012
admin rank
Re: Gold rims help -
Infinity90 - 06.06.2012
Here, You missed something
pawn Код:
COMMAND:goldrim(playerid,params[])
{
if(IsPlayerAdmin(playerid) >= 1337) {
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
return 1; // You missed this (return 1)
}
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_TWWHITE, "You Successfully Turned normal rims to gold rims!");
SendClientMessage(playerid, COLOR_TWWHITE, "Thanks for using Gold Rims system by Simon.");
KillTimer(WTimer2);
KillTimer(WTimer3);
KillTimer(WTimer4);
KillTimer(WTimer5);
KillTimer(WTimer6);
KillTimer(WTimer7);
WTimer1 = SetTimerEx("Wheel1", 600, 0, "d" ,playerid);
}
else
{
SendClientMessage(playerid, COLOR_TWWHITE, "You Must Be Inside A Vehicle To Use This Command!");
}
return 1;
}
Re: Gold rims help -
Neo Karls - 06.06.2012
Filterscript directly linked with Rcon Admin , So if you want to make it in admin rank you have to edit and make it in to main script (gamemode). Then only the defined admin variable works
Re: Gold rims help -
JaKe Elite - 06.06.2012
you have to create register/login system
AW: Gold rims help -
Josh_Main - 06.06.2012
Thanks man
AW: Gold rims help -
Josh_Main - 06.06.2012
cannot read from the file ''zcmd''
Re: Gold rims help -
Infinity90 - 06.06.2012
Have you got ZCMD? include or #include <zcmd> at the top of your script? If not place #include <zcmd> under a_samp include
AW: Gold rims help -
Josh_Main - 06.06.2012
yeah but i dont know if i have the include, where can i download it?