Car Repair With Timer.
#1

I am Trying to make a vip cmd /vfix to fix cars i found this https://sampwiki.blast.hk/wiki/RepairVehicle But i cant attach it with timer and vip system so any help ?
Anyway here is an example of the vip system:
Код:
CMD:weapon(playerid, params[]) {
    if(Player[playerid][vipLevel] < 1) return SendClientMessage(playerid, 0xF8F8F8FFF,"[ERROR]: You need to be Standard VIP at-least to use this CMD.");
    GivePlayerWeapon(playerid, 24, 500);
    return 1;
}
Reply
#2

Here you go:

Код:
if(strcmp(cmd, "/vfix", true) == 0)
{
if(IsPlayerVipType(playerid,2))
{
SetVehicleHealth(vehicleid, 1000);
}
else SendClientMessage(playerid, COLOR_WHITE, "ERROR: You not is a Silver or Gold Member!");
return 1;
}
Reply
#3

Delete...
Reply
#4

Sorry but i am using vipLevel not IsPlayerVipType and i am using zcmd too anyway Thanks for Your reply.
Reply
#5

lol, isn't hard to change that with your variables...
PHP код:
CMD:vfix(playeridparams[])
{
    if(
Player[playerid][vipLevel] != 0)
    {
        
SetVehicleHealth(vehicleid1000);
    }
    else 
SendClientMessage(playerid0xF8F8F8FFF,"[ERROR]: You need to be Standard VIP at-least to use this CMD.");
    return 
1;

Or, easier...
PHP код:
CMD:vfix(playeridparams[])
{
    if(
Player[playerid][vipLevel] < 1) return SendClientMessage(playerid0xF8F8F8FFF,"[ERROR]: You need to be Standard VIP at-least to use this CMD.");
    
SetVehicleHealth(vehicleid1000);
    return 
1;

Reply
#6

i made this but i got vehicleid not defined.
PHP код:
CMD:vfix(playeridparams[])
{
    if(
Player[playerid][vipLevel] < 1) return SendClientMessage(playerid0xF8F8F8FFF,"[ERROR]: You need to be Standard VIP at-least to use this CMD.");
    
SetVehicleHealth(vehicleid1000);
    return 
1;

Reply
#7

You must check if player is in any vehicle first.
pawn Код:
if(IsPlayerInAnyVehicle(playerid))
    SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
You can have a global timer to loop through the players who have vip fix enabled. I'd suggest using a custom array list containing the ids of those who enabled or by using foreach.
https://sampwiki.blast.hk/wiki/SetTimer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)