Posts: 512
Threads: 121
Joined: Sep 2013
Hi I have a auto/repair fix in my server. And I made a /cs - deathmatch where there are vehicle tanks and other dm vehicles. But everytime I hit them with rockets machineguns it autofix/repair. So whats the use of deathmatch then right? Can you please help me how to disable it? Thanks
Posts: 166
Threads: 13
Joined: Aug 2009
Reputation:
0
I would help you if you show me some code.....
Probably add a variable that's true outside dm arena and false inside it.
Posts: 512
Threads: 121
Joined: Sep 2013
Quote:
Originally Posted by mahdi499
I would help you if you show me some code.....
Probably add a variable that's true outside dm arena and false inside it.
|
Oops I forgot to show the codes here it is...
Under onplayerconnect
Код:
SetTimerEx("VRepair",500,true,"i",playerid);
Код:
forward VRepair(playerid);
public VRepair(playerid)
{
if(IsPlayerInAnyVehicle(playerid)) RepairVehicle(GetPlayerVehicleID(playerid));
return 1;
}
Deathmatch area
Код:
new str[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(str, sizeof(str), "{09F7DF}(/cs) {ffd700}%s {09F7DF}has Teleported to Counter-Strike Deathmatch",pName);
GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Counter-Strike",2000,3);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
SetPlayerVirtualWorld(playerid, 11);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SaveWeapons(playerid);
ResetPlayerWeapons(playerid); //must be added before this
GivePlayerWeapon(playerid, 41, 100000);
GivePlayerWeapon(playerid, 24, 100000);
GivePlayerWeapon(playerid, 26, 100000);
GivePlayerWeapon(playerid, 28, 100000);
GivePlayerWeapon(playerid, 30, 100000);
GivePlayerWeapon(playerid, 33, 100000);
DestroyVehicle(GetPlayerVehicleID(playerid));
SendClientMessageToAll(0xFFFFFFFF, str);
new Random = random(sizeof(RandomSpawnCsDM));
SetPlayerPos(playerid, RandomSpawnCsDM[Random][0], RandomSpawnCsDM[Random][1], RandomSpawnCsDM[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnCsDM[Random][3]);
return 1;
}
Posts: 512
Threads: 121
Joined: Sep 2013
Quote:
Originally Posted by mahdi499
What i can suggest is
pawn Код:
new Allowed[MAX_PLAYERS]; public VRepair(playerid) { if(IsPlayerInAnyVehicle(playerid) && Allowed == 1) RepairVehicle(GetPlayerVehicleID(playerid)); return 1; }
and make it when player enters DM arena Allowed = 0 and when he Exits Allowed = 1
|
Good Idea. But why this warning shows up?
Код:
error 033: array must be indexed (variable "Allowed")
also if its okay to you if you can show to whole script for this?
this what you wrote "and make it when player enters DM arena Allowed = 0 and when he Exits Allowed = 1"
To xVIP3Rx : i will try youyrs
EDIT: viper it still repairs.
Posts: 512
Threads: 121
Joined: Sep 2013
thanks works like a charm! +rep both
Posts: 166
Threads: 13
Joined: Aug 2009
Reputation:
0
Yeah sorry,haven't touch pawno for a long time,so i didn't remember to add [playerid]