03.11.2012, 00:22
I require assistance again
I have this
When someone requires there car fixed someone from the assistance team can do /fixveh near their car and it shows a dialog confirming the fix..
This works aboslutely fine, however how would i award the player that sent the command(/fixveh) money?
Thanks in advance
I have this
PHP код:
CMD:fixveh(playerid, params[])
{
new vehicleid;
vehicleid = GetClosestVehiclePolice(playerid);
for (new checkvehicle; checkvehicle < MAX_PLAYERS; checkvehicle++)
if(IsPlayerInVehicle(checkvehicle, vehicleid))
{
if(gTeam[playerid] == ASSISTANCE) // Learn how to use if statements
{
ShowPlayerDialog(checkvehicle, FIX_D, DIALOG_STYLE_MSGBOX, "Repair", "Would you like your vehicle repaired?", "Yes", "No");
SendClientMessage(playerid, -1,"Repair request sent!");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "There isn't a player in this car");
}
}
return 1;
}
PHP код:
case FIX_D:
{
if (!response) return SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
if(response)
{
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_WHITE, "Your Vehicle has been repaired.");
GivePlayerMoney(playerid, -500);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}
}
Thanks in advance