Own scripts.dll commands [message #236066] |
Wed, 27 December 2006 15:18 |
DodgeThis
Messages: 29 Registered: December 2006
Karma: 0
|
Recruit |
|
|
I'm totally new to modding scripts.dll and new to c++. I followed many of these tutorials and now I think i know the basics of c++
To improve my not very developed skills I'm trying to make my own server side scripts...
I want to add my own custom commands...
I added this line to the scripts.dll (i know it's cheating but it's only to try it )
else if (stricmp(Msg2,"!setcash <player> <amount>") == 0)
{
// code
}
So if you say in teamchat "!setcash DodgeThis 800" it will set the cash of player DodgeThis to 800
Now i want to include that it only executes the code if it is me who said it, and that it works on the <player> with the <amount>
Does anyone knows how to do this?
I thought by myself it was something like
else if (stricmp(Msg2,"!setcash <player> <amount>") == 0 && strincmp(Get_Player_ID(sender), DodgeThis)
{
// code
}
[Updated on: Wed, 27 December 2006 15:40] Report message to a moderator
|
|
|
|
Re: Own scripts.dll commands [message #236070 is a reply to message #236069] |
Wed, 27 December 2006 15:38 |
DodgeThis
Messages: 29 Registered: December 2006
Karma: 0
|
Recruit |
|
|
saberhawk wrote on Wed, 27 December 2006 23:36 |
else if ((stricmp(Msg2,"!setcash <player> <amount>") == 0) && (stringcmp(Get_Player_ID(sender), DodgeThis) == 0))
{
// code
}
|
oh thanks ^^ forgot some little things
but now.. i assume that you HAVE to type "!setcash <player> <amount>" and the whole code is not working if you type "!setcash friend1 100"
[Updated on: Wed, 27 December 2006 15:41] Report message to a moderator
|
|
|
|
|
Re: Own scripts.dll commands [message #236182 is a reply to message #236146] |
Thu, 28 December 2006 11:54 |
DodgeThis
Messages: 29 Registered: December 2006
Karma: 0
|
Recruit |
|
|
Cat998 wrote on Thu, 28 December 2006 16:01 | why it
does not automatically replace <player> and <amount>.
|
I wrote | but now.. i assume that you HAVE to type "!setcash <player> <amount>" and the whole code is not working if you type "!setcash friend1 100"
|
I already said that ^^ but indeed, I have to learn more of it to mod scripts.dll
|
|
|