SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/09/2018, 08:35 PM   #1
TaligaroW
Little Clucker
 
Join Date: Jun 2018
Posts: 24
Reputation: 0
Default Command Problem

Hello everyone,today i made 2 command which basically show admin command

the first command is /level2
PHP Code:
CMD:level2(playerid,params[])
{
GetPlayerName(playerid,name,sizeof(name));
format(iname,sizeof(iname),"%s.ini",name);
if (
dini_Int(iname,"Admin")<2)
{
SendClientMessage(playerid,COLOR_RED"Нямаш права за тази команда");
return 
1;
}
new 
lev2[23000];
strins(lev2,"{EB4457}akill - убиване на играч\n",strlen(lev2));
strins(lev2,"{63E5E7}disarm - отнемане оръжията на играч\n",strlen(lev2));
strins(lev2,"{EB4457}setarmour - задаване броня на играч\n",strlen(lev2));
strins(lev2,"{63E5E7}destroycar - унищожаване на превозно средство\n",strlen(lev2));
strins(lev2,"{EB4457}check - проверява статистиката на играч\n",strlen(lev2));
strins(lev2,"{63E5E7}jail - вкарване на играч в затвора\n",strlen(lev2));
strins(lev2,"{EB4457}unjail - изкарване на играч от затвора\n",strlen(lev2));
ShowPlayerDialog(playerid,6,DIALOG_STYLE_MSGBOX,"{EB4457}Admin Level 2"lev2,"OK","Cancel");
return 
1;

And here is the second command:
PHP Code:
CMD:level6(playerid,params[])
{
GetPlayerName(playerid,name,sizeof(name));
format(iname,sizeof(iname),"%s.ini",name);
if (
dini_Int(iname,"Admin")<6)
{
SendClientMessage(playerid,COLOR_RED"Нямаш права за тази команда");
return 
1;
}
new 
lev6[23000];
strins(lev6,"{EB4457}restart - рестартира сървъра\n",strlen(lev6));
strins(lev6,"{63E5E7}makeadmin - прави админ\n",strlen(lev6));
strins(lev6,"{EB4457}makevip - прави вип\n",strlen(lev6));
strins(lev6,"{63E5E7}tombn - слагаш макс идта в томболата\n",strlen(lev6));
strins(lev6,"{EB4457}tomb - теглиш томболата\n",strlen(lev6));
strins(lev6,"{63E5E7}revrestart - отменя рестартирането на сървъра\n",strlen(lev6));
strins(lev6,"{EB4457}awarn - слагане на админ предупреждение\n",strlen(lev6));
strins(lev6,"{63E5E7}rma - премахва DJ правата на играч\n",strlen(lev6));
strins(lev6,"{EB4457}muteall - заглушава всички играчи в сървъра\n",strlen(lev6));
strins(lev6,"{63E5E7}unmuteall - отглушава всички играчи в сървъра\n",strlen(lev6));
ShowPlayerDialog(playerid,6,DIALOG_STYLE_MSGBOX,"{EB4457}Admin Level 6",lev6,"OK","");
return 
1;

So the problem is,when i type /level2 or /level6 it says [MY SERVERNAME] The selected command is not found. See /help for more info!
TaligaroW is offline   Reply With Quote
Old 29/09/2018, 08:42 PM   #2
solstice_
Gangsta
 
solstice_'s Avatar
 
Join Date: Feb 2016
Location: basement
Posts: 540
Reputation: 68
Default Re: Command Problem

Fix your identation and come back, it's terrible, also:
PHP Code:
new lev6[23000]; 
Why 23000?
solstice_ is offline   Reply With Quote
Old 29/09/2018, 08:45 PM   #3
TaligaroW
Little Clucker
 
Join Date: Jun 2018
Posts: 24
Reputation: 0
Default Re: Command Problem

Quote:
Originally Posted by willbedie View Post
Fix your identation and come back, it's terrible, also:
PHP Code:
new lev6[23000]; 
Why 23000?
but i even don't know how to fix this shit..
TaligaroW is offline   Reply With Quote
Old 29/09/2018, 08:46 PM   #4
solstice_
Gangsta
 
solstice_'s Avatar
 
Join Date: Feb 2016
Location: basement
Posts: 540
Reputation: 68
Default Re: Command Problem

Just select everything except {} and press tab.
solstice_ is offline   Reply With Quote
Old 29/09/2018, 08:53 PM   #5
TaligaroW
Little Clucker
 
Join Date: Jun 2018
Posts: 24
Reputation: 0
Default Re: Command Problem

Quote:
Originally Posted by willbedie View Post
Just select everything except {} and press tab.
PHP Code:
CMD:level6(playerid,params[])
{
    
GetPlayerName(playerid,name,sizeof(name));
    
format(iname,sizeof(iname),"%s.ini",name);
    if (
dini_Int(iname,"Admin")<6)
{
    
SendClientMessage(playerid,COLOR_RED"Нямаш права за тази команда");
    return 
1;
}
  new 
lev6[256];
    
strins(lev6,"{EB4457}restart - рестартира сървъра\n",strlen(lev6));
    
strins(lev6,"{63E5E7}makeadmin - прави админ\n",strlen(lev6));
    
strins(lev6,"{EB4457}makevip - прави вип\n",strlen(lev6));
    
strins(lev6,"{63E5E7}tombn - слагаш макс идта в томболата\n",strlen(lev6));
    
strins(lev6,"{EB4457}tomb - теглиш томболата\n",strlen(lev6));
    
strins(lev6,"{63E5E7}revrestart - отменя рестартирането на сървъра\n",strlen(lev6));
    
strins(lev6,"{EB4457}awarn - слагане на админ предупреждение\n",strlen(lev6));
    
strins(lev6,"{63E5E7}rma - премахва DJ правата на играч\n",strlen(lev6));
    
strins(lev6,"{EB4457}muteall - заглушава всички играчи в сървъра\n",strlen(lev6));
    
strins(lev6,"{63E5E7}unmuteall - отглушава всички играчи в сървъра\n",strlen(lev6));
    
ShowPlayerDialog(playerid,6,DIALOG_STYLE_MSGBOX,"{EB4457}Admin Level 6",lev6,"OK","");
 return 
1;

Now it shows SERVER: Unknown command.
TaligaroW is offline   Reply With Quote
Old 29/09/2018, 08:56 PM   #6
solstice_
Gangsta
 
solstice_'s Avatar
 
Join Date: Feb 2016
Location: basement
Posts: 540
Reputation: 68
Default Re: Command Problem

Code:
CMD:level6(playerid,params[]) 
{ 
    GetPlayerName(playerid,name,sizeof(name)); 
    format(iname,sizeof(iname),"%s.ini",name); 
    if (dini_Int(iname,"Admin")<6) 
{ //What is this for?
    SendClientMessage(playerid,COLOR_RED, "Нямаш права за тази команда"); 
    return 1; 
}
solstice_ is offline   Reply With Quote
Old 29/09/2018, 08:57 PM   #7
TaligaroW
Little Clucker
 
Join Date: Jun 2018
Posts: 24
Reputation: 0
Default Re: Command Problem

Quote:
Originally Posted by willbedie View Post
Code:
CMD:level6(playerid,params[]) 
{ 
    GetPlayerName(playerid,name,sizeof(name)); 
    format(iname,sizeof(iname),"%s.ini",name); 
    if (dini_Int(iname,"Admin")<6) 
{ //What is this for?
    SendClientMessage(playerid,COLOR_RED, "Нямаш права за тази команда"); 
    return 1; 
}
This is if player is not atleast admin level 6 - it sends him message: You don't have permissions for this command!
TaligaroW is offline   Reply With Quote
Old 29/09/2018, 08:59 PM   #8
TaligaroW
Little Clucker
 
Join Date: Jun 2018
Posts: 24
Reputation: 0
Default Re: Command Problem

Sorry man but im new at scripting....
TaligaroW is offline   Reply With Quote
Old 30/09/2018, 04:36 AM   #9
CaptainBoi
Huge Clucker
 
CaptainBoi's Avatar
 
Join Date: May 2018
Location: Inside Game
Posts: 232
Reputation: 26
Default Re: Command Problem

use this
PHP Code:
CMD:level6(playerid,params[]) 

    new 
name[MAX_PLAYER_NAME], lev6[256];
    
GetPlayerName(playeridnameMAX_PLAYER_NAME); 
    
format(inamesizeof(iname), "%s.ini"name); 
    if(
dini_Int(iname,"Admin") < 6) return SendClientMessage(playerid,COLOR_RED"Нямаш права за тази команда");  
    
strcat((lev6"{EB4457}restart - рестартира сървъра\n"); 
    
strcat(lev6"{63E5E7}makeadmin - прави админ\n"); 
    
strcat(lev6"{EB4457}makevip - прави вип\n"); 
    
strcat(lev6"{63E5E7}tombn - слагаш макс идта в томболата\n"); 
    
strcat(lev6"{EB4457}tomb - теглиш томболата\n"); 
    
strcat(lev6"{63E5E7}revrestart - отменя рестартирането на сървъра\n"); 
    
strcat(lev6"{EB4457}awarn - слагане на админ предупреждение\n"); 
    
strcat(lev6"{63E5E7}rma - премахва DJ правата на играч\n")); 
    
strcat(lev6"{EB4457}muteall - заглушава всички играчи в сървъра\n"); 
    
strcat(lev6"{63E5E7}unmuteall - отглушава всички играчи в сървъра"); 
    
ShowPlayerDialog(playerid6DIALOG_STYLE_MSGBOX,"{EB4457}Admin Level 6"lev6"OK"""); 
    return 
1

__________________
Code:
Releases
[FilterScript] Dynamic MySQL GPS System
[Tutorial] How to make TDM Team Selection.
[Include] moneybar.inc || Coloured Moneybar || Released
[Tutorial] PAWN Compiler In Notepad++
[FilterScript] Perks System (v: [On Update]) [DINI, ZCMD]
[FilterScript] Realistic Transmission Speedometer
CaptainBoi is offline   Reply With Quote
Old 30/09/2018, 10:02 AM   #10
TaligaroW
Little Clucker
 
Join Date: Jun 2018
Posts: 24
Reputation: 0
Default Re: Command Problem

Quote:
Originally Posted by CaptainBoi View Post
use this
PHP Code:
CMD:level6(playerid,params[]) 

    new 
name[MAX_PLAYER_NAME], lev6[256];
    
GetPlayerName(playeridnameMAX_PLAYER_NAME); 
    
format(inamesizeof(iname), "%s.ini"name); 
    if(
dini_Int(iname,"Admin") < 6) return SendClientMessage(playerid,COLOR_RED"Нямаш права за тази команда");  
    
strcat((lev6"{EB4457}restart - рестартира сървъра\n"); 
    
strcat(lev6"{63E5E7}makeadmin - прави админ\n"); 
    
strcat(lev6"{EB4457}makevip - прави вип\n"); 
    
strcat(lev6"{63E5E7}tombn - слагаш макс идта в томболата\n"); 
    
strcat(lev6"{EB4457}tomb - теглиш томболата\n"); 
    
strcat(lev6"{63E5E7}revrestart - отменя рестартирането на сървъра\n"); 
    
strcat(lev6"{EB4457}awarn - слагане на админ предупреждение\n"); 
    
strcat(lev6"{63E5E7}rma - премахва DJ правата на играч\n")); 
    
strcat(lev6"{EB4457}muteall - заглушава всички играчи в сървъра\n"); 
    
strcat(lev6"{63E5E7}unmuteall - отглушава всички играчи в сървъра"); 
    
ShowPlayerDialog(playerid6DIALOG_STYLE_MSGBOX,"{EB4457}Admin Level 6"lev6"OK"""); 
    return 
1

thanks alot repped!
TaligaroW is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with YCMD proces command and problem with "Server:Unknown command JoDe Scripting Help 1 20/04/2018 12:12 PM
Problem with command. Only returns Server: Unknown Command Knappen Scripting Help 9 18/12/2013 06:09 PM
Problem with command , UNKNOWN COMMAND Jony_Cruze Server Support 4 05/01/2013 06:04 AM
Problem with command , UNKNOWN COMMAND Jony_Cruze Scripting Help 29 20/12/2012 03:17 PM
Command problem(gate command) pliptm Help Archive 0 01/06/2011 05:35 PM


All times are GMT. The time now is 04:02 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.