SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 26/08/2011, 01:16 PM   #1
Ammo
Huge Clucker
 
Ammo's Avatar
 
Join Date: Aug 2011
Location: Earth :d
Posts: 215
Reputation: 20
Default ..:: /credits command::.. ??

how to make /credits command and some tretx commands like /rules /founders ......
Ammo is offline   Reply With Quote
Old 26/08/2011, 01:19 PM   #2
knackworst
Gangsta
 
knackworst's Avatar
 
Join Date: Sep 2010
Location: Belgium
Posts: 924
Reputation: 23
Default Re: ..:: /credits command::.. ??

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;
   }
here's an example
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:

http://wiki.sa-mp.com/wiki/OnPlayerCommandText
http://wiki.sa-mp.com/wiki/SendClientMessage
knackworst is offline   Reply With Quote
Old 26/08/2011, 01:22 PM   #3
Amel_PAtomAXx
Huge Clucker
 
Amel_PAtomAXx's Avatar
 
Join Date: Mar 2011
Location: Moon
Posts: 261
Reputation: 16
Default Re: ..:: /credits command::.. ??

pawn Code:
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;
}
etc...
pawn Code:
if(strcmp(cmdtext,"/rules",true)== 0)
{
    SendClientMessage(playerid,0xFF0000FF,"Do not cheat here!"); // and something like that
    return 1;
}
Amel_PAtomAXx is offline   Reply With Quote
Old 26/08/2011, 01:24 PM   #4
Kingunit
High-roller
 
Kingunit's Avatar
 
Join Date: Dec 2010
Location: The Netherlands
Posts: 1,495
Reputation: 120
Default Re: ..:: /credits command::.. ??

Quote:
Originally Posted by knackworst View Post
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;
   }
here's an example
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:

http://wiki.sa-mp.com/wiki/OnPlayerCommandText
http://wiki.sa-mp.com/wiki/SendClientMessage
Didn't you ripped that outta gamemode?
Here is also a example ZCMD:

pawn Code:
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;
}
__________________
Kingunit is offline   Reply With Quote
Old 26/08/2011, 01:25 PM   #5
knackworst
Gangsta
 
knackworst's Avatar
 
Join Date: Sep 2010
Location: Belgium
Posts: 924
Reputation: 23
Default Re: ..:: /credits command::.. ??

Quote:
Originally Posted by Kingunit View Post
Didn't you ripped that outta gamemode?
Here is also a example ZCMD:
Yes I ripped it outa my selfmade gamemode... I think that's legal -_-
knackworst is offline   Reply With Quote
Old 26/08/2011, 01:26 PM   #6
PhoenixB
Huge Clucker
 
PhoenixB's Avatar
 
Join Date: Mar 2011
Location: Pawno.exe
Posts: 430
Reputation: 43
Default Re: ..:: /credits command::.. ??

Simple really, just using SendClientMessage with a little bit of colour. Here is an Example via STRCMP and ZCMD

ZCMD method:
pawn Code:
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;

STRCMP Method:
pawn Code:
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;
PhoenixB is offline   Reply With Quote
Old 25/06/2012, 07:51 PM   #7
Shouty
Little Clucker
 
Join Date: Jun 2012
Posts: 48
Reputation: 0
Default Re: ..:: /credits command::.. ??

Better...


Code:
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;
}
Shouty is offline   Reply With Quote
Old 25/06/2012, 07:53 PM   #8
Kindred
High-roller
 
Kindred's Avatar
 
Join Date: Aug 2011
Location: The Netherlands
Posts: 1,361
Reputation: 256
Default Re: ..:: /credits command::.. ??

Why in the hell did you update a one year old thread?

Code:
This forum requires that you wait 120 seconds between posts. Please try again in 26 seconds.
__________________
Kindred 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
Credits Kwarde Help Archive 2 13/04/2011 05:56 AM
help please (credits will be awarded) luigifan9 Help Archive 3 17/04/2010 01:50 AM
Only for [tag] (Giving Credits!) Sal_Kings Help Archive 1 07/08/2009 09:47 PM


All times are GMT. The time now is 12:54 PM.


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