26.08.2011, 13:16
how to make /credits command and some tretx commands like /rules /founders ......
if(strcmp("/credits", cmdtext, true) == 0)
{
SendClientMessage(playerid, COLOR_RED, "List server credits");
SendClientMessage(playerid, COLOR_YELLOW, "Server owner: [TI]knackworst");
SendClientMessage(playerid, COLOR_YELLOW, "Server Hoster: Nightdarkness");
SendClientMessage(playerid, COLOR_YELLOW, "Server Scripters: knackworst, Libra and Nightdarkness");
SendClientMessage(playerid, COLOR_YELLOW, "Server Site Maker: Nightdarkness and Knackworst");
SendClientMessage(playerid, COLOR_YELLOW, "Server Site: http://www.stuntacular.smffy.com/");
SendClientMessage(playerid, COLOR_YELLOW, "Server Mappers: Sam, [SU]iHateLolypops, knackworst ,Libra, Isus and Nightdarkness");
SendClientMessage(playerid, COLOR_YELLOW, "Server IRC Chat Maker: Sam");
SendClientMessage(playerid, COLOR_YELLOW, "Server IRC Chat: www.tirc.tk");
SendClientMessage(playerid, COLOR_YELLOW, "____________________________________________");
SendClientMessage(playerid, COLOR_GREEN, "Without these people this server wouldn't have been successful. (scroll up for all the messages!)");
return 1;
}
if(strcmp(cmdtext,"/credits",true)== 0)
{
SendClientMessage(playerid,0xFFFFFFFF,"--------------------- CERDITS ----------------------");
SendClientMessage(playerid,0xFF0000FF,"-- Server Owner : TheRockstar");
SendClientMessage(playerid,0xFF0000FF,"-- Server Scripter : name");
SendClientMessage(playerid,0xFF0000FF,"-- Server Mapper : name");
SendClientMessage(playerid,0xFFFFFFFF,"-----------------------------------------------------");
return 1;
}
if(strcmp(cmdtext,"/rules",true)== 0)
{
SendClientMessage(playerid,0xFF0000FF,"Do not cheat here!"); // and something like that
return 1;
}
|
Code:
if(strcmp("/credits", cmdtext, true) == 0)
{
SendClientMessage(playerid, COLOR_RED, "List server credits");
SendClientMessage(playerid, COLOR_YELLOW, "Server owner: [TI]knackworst");
SendClientMessage(playerid, COLOR_YELLOW, "Server Hoster: Nightdarkness");
SendClientMessage(playerid, COLOR_YELLOW, "Server Scripters: knackworst, Libra and Nightdarkness");
SendClientMessage(playerid, COLOR_YELLOW, "Server Site Maker: Nightdarkness and Knackworst");
SendClientMessage(playerid, COLOR_YELLOW, "Server Site: http://www.stuntacular.smffy.com/");
SendClientMessage(playerid, COLOR_YELLOW, "Server Mappers: Sam, [SU]iHateLolypops, knackworst ,Libra, Isus and Nightdarkness");
SendClientMessage(playerid, COLOR_YELLOW, "Server IRC Chat Maker: Sam");
SendClientMessage(playerid, COLOR_YELLOW, "Server IRC Chat: www.tirc.tk");
SendClientMessage(playerid, COLOR_YELLOW, "____________________________________________");
SendClientMessage(playerid, COLOR_GREEN, "Without these people this server wouldn't have been successful. (scroll up for all the messages!)");
return 1;
}
put it in between: OnPlayerCommandText { 'put the code I sent u here' return 0; } Now all you have to do is change my lines and write stuff u want about the functions used: https://sampwiki.blast.hk/wiki/OnPlayerCommandText https://sampwiki.blast.hk/wiki/SendClientMessage |
CMD:credits(playerid, params[])
{
SendClientMessage(playerid,COLOR_WHITE, ".:: Credits ::.");
SendClientMessage(playerid,COLOR_WHITE, "This script is made by Kingunit.");
SendClientMessage(playerid,COLOR_WHITE, "He just bought a new dildo yesterday");
// Go on with those SendClientMessage's
return 1;
}
CMD:credits(playerid, params[]) // NOTE: You will need ZCMD include.
{
SendClientMessage(playerid, COLOURCODE_HERE(or HEX), "Type in here things such as I own this server");
return 1;
}
// And just copy the SendClientMessage Line and paste it above your return 1;
if(strcmp("/credits", cmdtext, true) == 0) // Under OnPlayerCommandText
{
SendClientMessage(playerid, COLOURCODE_HERE(or HEX), "Type in here things such as I own this server");
return 1;
}
// And just copy the SendClientMessage Line and paste it above your return 1;
if(strcmp("/credits", cmdtext, true) == 0) // Under OnPlayerCommandText
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Credits","Server Owner: Blah Blah\nServer Scripter : Blah blah\nServer Mapper: Blah blah","Ok","Exit");
return 1;
}
This forum requires that you wait 120 seconds between posts. Please try again in 26 seconds.