samedi 23 juillet 2016

Help me here to set Instafix/vehicle repair.

#include
#include
#include
#include
#include
#define Instafix
#define DIALOG_CARSHOP 1

new float:Instafix[MAX_PLAYERS];

enum{
DIALOG_CARSHOP 1
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
CMD:i(playerid,params[]){
if (VehicleRepairs[playerid] > 1) return RepairVehicle(GetPlayerVehicleID(playerid));
Instafix(playerid) -= 1;
return 1;
}
CMD:vehshop(playerid){
if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xF00000, "Error:You are not in vehicle");
ShowPlayerDialog(playerid, DIALOG_CAPASHOP, DIALOG_STYLE_TABLIST,
"Repair\t$4400/n/
Instafix\t$4400",
"Select", "Close");
return 1;\
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_CARSHOP)
{
if(response) // If they clicked 'Select' or double-clicked a weapon
{
switch(listitem)
{
case 0:RepairVehicle(GetPlayerVehicleID(playerid));
case 1:
{
if (Instafix[playerid] == 0){
VehicleRepairs[playerid] = 1;
SendClientMessage(playerid, 0xF00000, "You got instafix type /i to use it");
}
}
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}

return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}

I want the player to get Instafix by clicking case 1. And car should be repaired with command /i if layer have instafix. After use decrease 1 instafix.
This should be for all players.

Help

Let's block ads! (Why?)



Help me here to set Instafix/vehicle repair.

Aucun commentaire:

Enregistrer un commentaire