22.02.2012, 17:02
I am very new to all of the PAWN scripting so yes I am a big noob. Now I have seen that on some servers there is a command like /cmds or /commands that will show all of the servers commands. I was wondering how I would go about making such a script.
I have a few commands that I would like to add to it like: /help /heal /kill and a few more eventually.
I know I am not using zcmd or anything like that but I want to learn everything the easy way as I am a beginner.
Any assistance would be greatly appreciated and would earn you +Reputation for your account.
I have a few commands that I would like to add to it like: /help /heal /kill and a few more eventually.
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/help", cmdtext, true, 10) == 0) { SendClientMessage(playerid, COLOR_1, "Welcome to my server Drifting Legends, I hope you enjoy your stay."); SendClientMessage(playerid, COLOR, "If you require any assistance then don't hesitate to ask our administrators."); return 1; } if (strcmp("/heal", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid, 100); SendClientMessage(playerid, COLOR, "Your health has been successfully restored."); return 1; } if (strcmp("/kill", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid, 0); return 1; } return 0; }
Any assistance would be greatly appreciated and would earn you +Reputation for your account.