Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: mrockxkingbutt on April 03, 2014, 03:13:42 pm
-
Add
Fixing[MAX_VEHICLES];
command [ put in OnPlayerCommand ]
else if (strcmp(cmd, "fix", true) == 0) {
if(Fixing[GetPlayerVehicleID(playerid)] == 1) SendClientMessage(playerid,COLOR_RED," Already Fixing This Vehicle ");
else if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,COLOR_RED," Not In Vehicle ");
else {
Fixing[GetPlayerVehicleID(playerid)] = 1;
SendClientMessage(playerid,COLOR_RED," Fixing ");
SetTimer("VehicleFixing", 10000, 0);
}
return 1;
}
Timer
forward VehicleFixing();
public VehicleFixing() {
for(new i ; i <MAX_VEHICLES;i++) {
if(Fixing[i] == 1) {
SetVehicleHealth(i, 1000);
SendClientMessageToAll(COLOR_GREEN," Vehicle Has Been Fixed ");
SetVehicleTyre(i,1);
Fixing[i] = 0;
}
}
return 1;
}
Credits : ME
-
Excuse the question, what you gain by copying others? ???
-
Excuse the question, what you gain by copying others? ???
Problem?
Besides..
its a working timer,
not like others...
besides its all change one
-
Are you cant see storm topic ?. You cant add SetTimers on Cmd. It only works on ongamemodeinit.
-
Are you cant see storm topic ?. You cant add SetTimers on Cmd. It only works on ongamemodeinit.
Not inherently true, but this timer really should only be set in OnGameModeInit. What I said was this:
You cannot pass an argument to a timer in VC:MP 0.3z r2
-
Add
Fixing[MAX_VEHICLES];
command [ put in OnPlayerCommand ]
else if (strcmp(cmd, "fix", true) == 0) {
if(Fixing[GetPlayerVehicleID(playerid)] == 1) SendClientMessage(playerid,COLOR_RED," Already Fixing This Vehicle ");
else if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,COLOR_RED," Not In Vehicle ");
else {
Fixing[GetPlayerVehicleID(playerid)] = 1;
SendClientMessage(playerid,COLOR_RED," Fixing ");
SetTimer("VehicleFixing", 10000, 0);
}
return 1;
}
Timer
forward VehicleFixing();
public VehicleFixing() {
for(new i ; i <MAX_VEHICLES;i++) {
if(Fixing[i] == 1) {
SetVehicleHealth(i, 1000);
SendClientMessageToAll(COLOR_GREEN," Vehicle Has Been Fixed ");
SetVehicleTyre(i,1);
Fixing[i] = 0;
}
}
return 1;
}
Credits : ME
Bugged !
player1: !fix
after few secs
player2: !fix
player2 healed instantly!!!