SA-MP Forums Archive
Help Please - 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: Help Please (/showthread.php?tid=637356)



Help Please - MetalBeard - 13.07.2017

guys , i want use commands , but must be minimal admin level 1

can you help this script ?

Quote:

if (strcmp("/Ahouse", cmdtext, true, 10) == 0)
{
GameTextForPlayer(playerid,"~g~Admin! ~r~House ! ~p~!!!",4000,6);
SetPlayerPos(playerid, -668.90002441,947.09997559,12.50000000);
return 1;
}

i want text like this : You can use this command minimal admin level 1


Re: Help Please - GuilhermeNunes - 13.07.2017

First you have to have an adm system and you have levels do one then get the variable and use

PHP код:
if(strcmp ("/ Ahouse"cmdtexttrue10) == 0

if(
padmin return SendClientMessage(playerid, -"You Not Is Admin");
GameTextForPlayer (playerid"~ g ~ Admin! ~ R ~ House ! ~ P ~ !!!"4000,6); 
SetPlayerPos (playerid, -668.90002441,947.09997559,12.50000000); 
Return1

This is an example will not work And number 1 is the level adm must have


Re: Help Please - Paulice - 13.07.2017

Place an if-then statement comparing the command user's admin level to a constant (a.k.a. 1).


Re: Help Please - MetalBeard - 13.07.2017

Quote:
Originally Posted by GuilhermeNunes
Посмотреть сообщение
First you have to have an adm system and you have levels do one then get the variable and use

PHP код:
if(strcmp ("/ Ahouse"cmdtexttrue10) == 0

if(
padmin 1); return SendClientMessage(playerid, -"You Not Is Admin");
GameTextForPlayer (playerid"~ g ~ Admin! ~ R ~ House ! ~ P ~ !!!"4000,6); 
SetPlayerPos (playerid, -668.90002441,947.09997559,12.50000000); 
Return1

This is an example will not work And number 1 is the level adm must have
not working xD


Re: Help Please - kubak01 - 13.07.2017

Quote:
Originally Posted by MetalBeard
Посмотреть сообщение
not working xD
We cannot provide you with working code until you show us what are the variables.


Re: Help Please - Paulice - 13.07.2017

Quote:
Originally Posted by GuilhermeNunes
Посмотреть сообщение
First you have to have an adm system and you have levels do one then get the variable and use

PHP код:
if(strcmp ("/ Ahouse"cmdtexttrue10) == 0

if(
padmin 1); return SendClientMessage(playerid, -"You Not Is Admin");
GameTextForPlayer (playerid"~ g ~ Admin! ~ R ~ House ! ~ P ~ !!!"4000,6); 
SetPlayerPos (playerid, -668.90002441,947.09997559,12.50000000); 
Return1

This is an example will not work And number 1 is the level adm must have
That semicolon does not go at the end of that if-then statement.


Re: Help Please - MetalBeard - 13.07.2017

the variable is
Код:
#include <a_samp>
#define FILTERSCRIPT
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_ALLDEPT 0xFF8282AA

#if defined FILTERSCRIPT
new shedgate1;
new shedgate2;
new housegate1;
new housegate2;



Re: Help Please - GuilhermeNunes - 13.07.2017

@MetalBeard
@Paulice
People I said above "IS AN EXAMPLE AND IT WILL NOT WORK" I put that code to better illustrate my explanation of what the guy should do when he has his


Re: Help Please - MetalBeard - 13.07.2017

maybe , i should always learn about scripting , if you cant to continue help , thanks bro , because you already want help me


Re: Help Please - Paulice - 13.07.2017

Quote:
Originally Posted by GuilhermeNunes
Посмотреть сообщение
@MetalBeard
@Paulice
People I said above "IS AN EXAMPLE AND IT WILL NOT WORK" I put that code to better illustrate my explanation of what the guy should do when he has his
I did not see your note, but either way, please refrain from posting code that does not even compile.

Quote:
Originally Posted by MetalBeard
Посмотреть сообщение
maybe , i should always learn about scripting , if you cant to continue help , thanks bro , because you already want help me
You're suppose to have an array where the users' admin level is stored in runtime for the restriction to take effect. If you do not have this array, please refer to a register/log-in tutorial before considering adding this restriction to commands.