[Tutorial] Simple repair cmd.
#1

Are you bored of repair filterscripts and you want to make your own repair system?

For now u can but /r or /repair cmd into your gamemode.

For starting add:
pawn Code:
if (!strcmp("/r", cmdtext))
    {
///this is becus u cant use repair command then...

Then add into next line :
pawn Code:
if(!IsPlayerInAnyVehicle(playerid))///server is stupid when server doesent know is player in vehicle or not.. -_-
Next add the
pawn Code:
return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in the vehicle!");
Wait bro add it in the same line...

in next line add :
pawn Code:
RepairVehicle(GetPlayerVehicleID(playerid));
///server needs repairing system u dumb bro..

in next line add:
pawn Code:
SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle is 1337% repaired!");
and for the end add into next line:
pawn Code:
return 1;
Its the end... Got any warning/error message? Comment or pm it!
Reply
#2

Why strcmp ? aren't there much better command processors such as ycmd , zcmd ?

///server is stupid when server doesent know is player in vehicle or not.. - server is not stupid and how call scripted game stuped ? server know correct if player is in vehicle and not and function tell to you if player is in vehicle or not

RepairVehicle(GetPlayerVehicleID(playerid)); - this line doesn't explaint anything

What are those words dump , bro, dump, stupid ? you are not talking to your friends!
Oveall nothing explained (use this , add this); you should read y_less's thread "how to create tutorial".
Reply
#3

Quote:
Originally Posted by doreto
View Post
Why strcmp ? aren't there much better command processors such as ycmd , zcmd ?

///server is stupid when server doesent know is player in vehicle or not.. - server is not stupid and how call scripted game stuped ? server know correct if player is in vehicle and not and function tell to you if player is in vehicle or not

RepairVehicle(GetPlayerVehicleID(playerid)); - this line doesn't explaint anything

What are those words dump , bro, dump, stupid ? you are not talking to your friends!
Oveall nothing explained (use this , add this); you should read y_less's thread "how to create tutorial".
well why i cant create strcmp tutorial? this is for newbs

Server isnt stupid, you got that right but, when you dont put that line server will repair that car you are on.
Reply
#4

Quote:
Originally Posted by Ryox175
View Post
well why i cant create strcmp tutorial? this is for newbs
People who are new to this are going to use strcmp because you told them and they will have no idea that this is bad.

Quote:
Originally Posted by Ryox175
View Post
Server isnt stupid, you got that right but, when you dont put that line server will repair that car you are on.
You should write this in your tutorial so people who what GetPlayerVehicleID do!
Reply
#5

In my opinion, strcmp is the hardest command processor to use, thank god we've got geniuses like Y_Less, Zeex, Dracoblue etc. etc.
Reply
#6

Quote:
Originally Posted by DanishHaq
View Post
In my opinion, strcmp is the hardest command processor to use, thank god we've got geniuses like Y_Less, Zeex, Dracoblue etc. etc.
First of all, strcmp is not even a command processor. It's string comparison. And no, it's not hard.
I guess you wanted to say, making commands with parameters using strtok is hard and to be honest, I don't know how to do it. It seems not understandable to me, that's why I started using ZCMD and Sscanf when I first started.

I also agree with doreto, making tutorials that use a bad habbit will force beginners use it too.
Reply
#7

Quote:
Originally Posted by Konstantinos
View Post
First of all, strcmp is not even a command processor. It's string comparison. And no, it's not hard.
I guess you wanted to say, making commands with parameters using strtok is hard and to be honest, I don't know how to do it. It seems not understandable to me, that's why I started using ZCMD and Sscanf when I first started.
Yea, that's basically what I wanted to say in a nutshell. I agree, that the parameters are hard using strtok, extremely difficult, I never understood it for the first few months I was using the bog standard OnPlayerCommandText. Then recently I got y_commands and sscanf, and now I make commands in a flash...
Reply
#8

I'm new in this thread about Pawn always I heard that ZMD is better than Strcmp and now I'm studying that system, in this way I think this topic is not useful and not explain anything should have one structure and order explaining step by step correctly. This is my opinion, I'm sorry if you don't like. and please do not talk as if we were your friends. there best words to write and so maybe we can understand. Thank you.
Reply
#9

Quote:
Originally Posted by Ryox175
View Post
this is for newbs
And being a newb doesn't entitle them to use the newest methods? Your logic is flawed.
Reply
#10

And it's not a good idea to use a commands - I think the best way is still by using OnPlayerKeyStateChange.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)