Need 2 Commands.. They don't work..
#1

Hello..

I am just trying to make a script for a car spawner...
But my car spawner won't work.. I can't just script properly..

Second.. I can't make a /repair command, Like /repair to fix the car , also Numpad + to fix the car too.. I can't really find a solution, someone please help?
Reply
#2

For the command:

pawn Код:
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;
    }

You will need to use "OnPlayerKeyStateChange" for the numpad one. I don't think "+" is a detectable key.

More information: https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply
#3

Thank's Mate
Reply
#4

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SUBMISSION)
    {
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
    }
    return 1;
}
That will work if you press number 2, the one that is above the key 'W'.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)