• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

No one of all these scripts works for me

SaLeM

New Member
Joined
Oct 14, 2007
Messages
97
Reaction score
0
Location
Spain
[SOLVED] No one of all these scripts works for me

Hi, well I have been trying some of this fantastic scripts. The problem is that no one of them works. I mean, when I type the command (without parameters), for example: /jail, or !save. They works fine, but the moment I specify a param, it doesn't work. It says out loud the command and no more:

Examples:

GM Me says:

/jail Ruppert
--------
GM Me says:

!save 30

greetz
 
Last edited:
Okay, I figured out that I must use " before a param.

Now, another question:

How could I add more than 1 parameter? I tried by writing this:

PHP:
function onSay(cid, words, param1,param2,param3,param4)

but it just recognize the first one.

Gretz.
 
Okay, I figured out that I must use " before a param.

Now, another question:

How could I add more than 1 parameter? I tried by writing this:

PHP:
function onSay(cid, words, param1,param2,param3,param4)

but it just recognize the first one.

Gretz.
You can't have more than one parameter.
!save "sdjafkljsdaf sdajfklsdjafklsjda fdsajfklsjdalfkjsda <-- it's still 1 parameter

Anyways, you can break between the words by comma and making the script differentiate what's before the comma than what's after.

Code:
local seperator = string.find(param, '%,')
local firstParam = string.sub(param, 1--[[firt param starts at first letter]], seperator-1--[[this part is to put an end to the first param before the comma]])
local secondParam = string.sub(param, seperator+1--[[This part so the second param starts after the comma by one space]], string.len(param)--[[This part is to end the second param at the end of the sentence]])

!save Damnbitch,stolemymoney

First param = Damnbitch
Second param = stolemymoney

I'm not sure of what I'm saying, but that's what I think is true.
 
Very thanks to you. I was planning to do that way, but I didn't know the LUA String functions. Now I have finished my script, you can see it in Talkactions forum. Thx

An finnaly, I have a last question about some scripts:

When I set a Player's storage value to -1, the script doesn't work. I debugged it and I saw that instead -1, the server set a weird value: 1.909948930e +14 or something like that. However, I looked for it on my SQL database, and amazingly its value is -1. Why, then, the server do not recognize -1 ?

Ty
 
Back
Top