13.08.2011, 15:50
Hi,
I've created some commands, but on the command /REPAIR, i can also type /abcdef or such things to activate the REPAIR command, and this is weird.
So far I got this:
I've created some commands, but on the command /REPAIR, i can also type /abcdef or such things to activate the REPAIR command, and this is weird.
So far I got this:
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/suicide", true, 8)) { SetPlayerHealth(playerid,0); SendClientMessage(playerid,COLOR_WHITE,"{FF0000}/SUICIDE: {FFFF00}You have killed yourself."); return 1; } if(!strcmp(cmdtext, "/repair", true, 8)) if (IsPlayerInAnyVehicle(playerid)==0) { if (GetPlayerMoney(playerid)<=99) { SendClientMessage(playerid,COLOR_WHITE,"{FF0000}/REPAIR: {FFFF00}You need at least {00FFFF}$100{FFFF00}, and you must be in a vehicle."); return 1; } if (GetPlayerMoney(playerid)>=99) { SendClientMessage(playerid,COLOR_WHITE,"{FF0000}/REPAIR: {FFFF00}You must be in a vehicle."); return 1; } return 1; } if (IsPlayerInAnyVehicle(playerid)==1) { if (GetPlayerMoney(playerid)<=99) { SendClientMessage(playerid,COLOR_WHITE,"{FF0000}/REPAIR: {FFFF00}You need at least {00FFFF}$100{FFFF00}."); return 1; } if (GetPlayerMoney(playerid)>=99) { GivePlayerMoney(playerid,-100); RepairVehicle(GetPlayerVehicleID(playerid)); SendClientMessage(playerid,COLOR_WHITE,"{FF0000}/REPAIR: {FFFF00}Vehicle repaired, {00FFFF}-$100{FFFF00}."); return 1; } return 1; } if(!strcmp(cmdtext, "/cmdlist", true, 8)) { SendClientMessage(playerid,COLOR_WHITE,"{FF0000}/CMDLIST {FFFFFF}- {FFFF00}List all commands in the {FF0000}Freeroam{FFFF00} gametype (this message)."); SendClientMessage(playerid,COLOR_WHITE,"{FF0000}/SUICIDE {FFFFFF}- {FFFF00}Kill your current player."); SendClientMessage(playerid,COLOR_WHITE,"{FF0000}/REPAIR {FFFFFF}- {FFFF00}Repair your current vehicle instantly for {00FFFF}$100{FFFF00}."); return 1; } return 0; }