Why doesnt this work?
#1

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/repair", cmdtext))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
        return 1;
    }
}
I've copied it directly from wiki sa, and even tho the script gives me no errors when i compile, command /repair does not repair my vehicles visable damage.
Help please.
Reply
#2

maybe ur callback's parameter isnt the same as the cmd

try
Код:
if(!strcmp("/repair", cmdtext, true))
Reply
#3

try
if(strcmp(cmdtext,"/repair",true) == 0)
Reply
#4

Both
Код:
if(strcmp(cmdtext,"/fix",true) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
        return 1;
    }
and

Код:
if(!strcmp("/repair", cmdtext, true))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
        return 1;
    }
Do not work. The engine damage gets fixed, but the damage such as broken doors or bumpers doesnt..
Reply
#5

Somebody??
Reply
#6

may I ask which SA-MP version you have?
as far as I know "RepairVehicle(ID)" is fixing the whole vehicle (visual and physical damage) since version 0.2 or so...
it sounds as if you have an old version
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)