SetCarHealth?
#1

Hi all,how to set a car health by a command?

Example: /setcarhealth 0-100

Thanks
Reply
#2

Correction: /setcarhealth 0-1000

But look up dcmd (or zcmd - which is faster), by using it, it's easy to make commands with parameters.

https://sampwiki.blast.hk/wiki/Fast_Commands
Reply
#3

I dont use dcmd or zcmd
Reply
#4

Then, either go use it or use strtok + strval
zcmd + sscanf is fastest even though i'd rather
dcmd + sscanf since dcmd is just a line and zcmd a include/plugin (dno)
strcmp + strtok = hmm... a long alternative.
Reply
#5

zcmd is an include, correct.
dcmd takes up more space in the script, so I can't see why you choose dcmd before zcmd, when it's less job using zcmd and it doesn't take extra space in your script.

Oh well, if you don't wanna learn dcmd/zcmd, use strtok or something.
And btw, no need for sscanf when in need of only one parameter, isnull is more than enough
Reply
#6

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
I dont use dcmd or zcmd
What do you use then?
Reply
#7

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
Then, either go use it or use strtok + strval
zcmd + sscanf is fastest even though i'd rather
dcmd + sscanf since dcmd is just a line and zcmd a include/plugin (dno)
strcmp + strtok = hmm... a long alternative.
Ignorance is bliss.

zcmd is easier to use in comparison to dcmd. You don't need to calculate the length of a command name, have a lengthy OnPlayerCommandText to declare your commands or anything. You just need to include zcmd and create a command like so:

pawn Код:
CMD:lol(playerid, params[]) {
   return 1;
}
Reply
#8

I know Zcmd is better then dcmd but when ur used to dcmd its easier, but zcmd isnt a big difference.... replace dcmd_ into CMD: so idont get it why i aint using it xD
since short i begin using sscanf, before i always used strval
Reply
#9

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
What do you use then?
The normal command code..

Код:
    if(strcmp(cmdtext, "/command", true) == 0)
    {
    ETC
    return true;
    }
Reply
#10

You can't make this command with only strcmp.

You need to learn how to make a command with parameters.

https://sampwiki.blast.hk/wiki/Fast_Commands
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)