SA-MP Forums Archive
Litte 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: Litte help.. (/showthread.php?tid=622945)



Litte help.. - Knowinne - 28.11.2016

Hello!!!!!

I want the same command like this picture below with zcmd



NOTE: This white colour means that it's deleted. So, add the other things that are written

Thanks,

+REP from me if you could help me a little bit!


Re: Litte help.. - Knowinne - 28.11.2016

Please? Sorry for bumping.


Re: Litte help.. - IceBilizard - 28.11.2016

PHP код:
#define DIALOG_COMMANDS 1
CMD:commands(playerid, params[])
{
    new 
string[1050];
    
format(string,sizeof(string), "%s{FFFFFF}Register: /register [password]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Change your password: /changepass [new password]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Server rules: /rules\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To report a player: /report [playerid] [reason]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Your inventory: /inventory\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Stats: /stats or /stats [ID]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Reset your stats (kills and deaths) /resetstats\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Online Admins: /admins | Server staffs: /serverstaffs\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Scripters: /scripters\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Slap a player: /slap [playerid] [reason]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To commit suicide: /kill\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To have sex with another player type /sex\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Fix your house, business and cars: /playerfix [ID]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Morning: /morning | Night: /night | /time | /fstyles | /class\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Duel: /duel | /countdown\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Laser: /laseron | /laseroff | /lasercol\n", string);
    
format(string,sizeof(string), "%s{FFFF00}Chat Commands\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To talk about yourself: /me | To Whisper to people in your vehicle: /cw\n\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Buy a skin by typing /buyskin\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To see the list of your vehicles or player vehicle, use /cars or /cars [ID]\n\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To see the list of people who contributed to the script, type /credits", string);
    
ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_MSGBOX, "{FFFF00}General Commands{FFFFFF}", string, "Ok", "");
    
    
    return 
1;
} 



Re: Litte help.. - Knowinne - 28.11.2016

Код:
C:\Users\ўггелпт\Desktop\NFTDM\gamemodes\NFTDM[3z].pwn(21794) : error 029: invalid expression, assumed zero
C:\Users\ўггелпт\Desktop\NFTDM\gamemodes\NFTDM[3z].pwn(21794) : warning 215: expression has no effect
C:\Users\ўггелпт\Desktop\NFTDM\gamemodes\NFTDM[3z].pwn(21794) : warning 215: expression has no effect
C:\Users\ўггелпт\Desktop\NFTDM\gamemodes\NFTDM[3z].pwn(21794) : warning 215: expression has no effect
C:\Users\ўггелпт\Desktop\NFTDM\gamemodes\NFTDM[3z].pwn(21794) : warning 215: expression has no effect
C:\Users\ўггелпт\Desktop\NFTDM\gamemodes\NFTDM[3z].pwn(21794) : warning 215: expression has no effect
C:\Users\ўггелпт\Desktop\NFTDM\gamemodes\NFTDM[3z].pwn(21794) : error 001: expected token: ";", but found ")"
C:\Users\ўггелпт\Desktop\NFTDM\gamemodes\NFTDM[3z].pwn(21794) : error 029: invalid expression, assumed zero
C:\Users\ўггелпт\Desktop\NFTDM\gamemodes\NFTDM[3z].pwn(21794) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: Litte help.. - Gusteakas - 28.11.2016

Try using strcat


Re: Litte help.. - IceBilizard - 28.11.2016

I have tested this working fine for me post line 21794


Re: Litte help.. - Gusteakas - 28.11.2016

deleted.


Re: Litte help.. - IceBilizard - 28.11.2016

I don't post any code without testing


Re: Litte help.. - Knowinne - 28.11.2016

Sorry, my fault. Relax I just forgot the #define DIALOG_COMMANDS 1 The "1". Thanks! +REP!


Re: Litte help.. - Stinged - 28.11.2016

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
PHP код:
#define DIALOG_COMMANDS 1
CMD:commands(playerid, params[])
{
    new 
string[1050];
    
format(string,sizeof(string), "%s{FFFFFF}Register: /register [password]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Change your password: /changepass [new password]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Server rules: /rules\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To report a player: /report [playerid] [reason]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Your inventory: /inventory\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Stats: /stats or /stats [ID]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Reset your stats (kills and deaths) /resetstats\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Online Admins: /admins | Server staffs: /serverstaffs\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Scripters: /scripters\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Slap a player: /slap [playerid] [reason]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To commit suicide: /kill\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To have sex with another player type /sex\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Fix your house, business and cars: /playerfix [ID]\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Morning: /morning | Night: /night | /time | /fstyles | /class\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Duel: /duel | /countdown\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Laser: /laseron | /laseroff | /lasercol\n", string);
    
format(string,sizeof(string), "%s{FFFF00}Chat Commands\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To talk about yourself: /me | To Whisper to people in your vehicle: /cw\n\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}Buy a skin by typing /buyskin\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To see the list of your vehicles or player vehicle, use /cars or /cars [ID]\n\n", string);
    
format(string,sizeof(string), "%s{FFFFFF}To see the list of people who contributed to the script, type /credits", string);
    
ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_MSGBOX, "{FFFF00}General Commands{FFFFFF}", string, "Ok", "");
    
    
    return 
1;
} 
Why format though? Since there aren't any values that you're inserting (other than the first %s to add to the string), you should use strcat. It's much faster.