Lock Car For 2 Minutes +Rep for True Code -
Ramin - 07.01.2017
I Need Help For Lock Car 2 minutes
PHP код:
CMD:derby(playerid, params[])
{
if (My_Interior[playerid] == 15)
{
SendClientMessage(playerid,COLOR_BLUE,"Shoma Hamaknoon Dakhele Derby Hasti");
}
else if(DerbyNumber == 1)
{
DerbyNumber += 1;
My_Interior[playerid] = 15;
new bloodring_id, string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "{6666FF}(/derby) {00CCFF}%s {6666FF}Teleport Shod Be Derby", pName);
SendClientMessageToAll(0xFFFFFFFF, string);
SendClientMessage(playerid,COLOR_RED,"Baraye Khoroj Az Derby Bezanid /leavederby");
GameTextForPlayer(playerid,"~y~Khoshoomadi Be ~n~~b~Derby Deathmatch", 2000, 3);
SetPlayerPos(playerid, -1356.5100, 932.1922, 1036.1119);
SetPlayerInterior(playerid, 15);
SetPlayerVirtualWorld(playerid, 15);
bloodring_id = CreateVehicle(504, -1356.5100, 932.1922, 1036.1119, 0.0, 0, 0, -1);
LinkVehicleToInterior(bloodring_id, 15);
SetVehicleVirtualWorld(bloodring_id, 15);
PutPlayerInVehicle(playerid, bloodring_id, 0);
SetPlayerHealth(playerid, 100);
/* Lock Car For 2 Minutes And When the two minutes have passed Check if DerbyNumber >= 2 Show coultdown 3, 2, 1, Go! And Unlock The Car*/
}
}
Re: Lock Car For 2 Minutes +Rep for True Code -
StrikerZ - 07.01.2017
PHP код:
new bloodring_id[MAX_PLAYERS]; // Make this as a global variable as this will be used in public functions
CMD:derby(playerid, params[])
{
if (My_Interior[playerid] == 15)
{
SendClientMessage(playerid,COLOR_BLUE,"Shoma Hamaknoon Dakhele Derby Hasti");
}
else if(DerbyNumber == 1)
{
DerbyNumber += 1;
My_Interior[playerid] = 15;
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "{6666FF}(/derby) {00CCFF}%s {6666FF}Teleport Shod Be Derby", pName);
SendClientMessageToAll(0xFFFFFFFF, string);
SendClientMessage(playerid,COLOR_RED,"Baraye Khoroj Az Derby Bezanid /leavederby");
GameTextForPlayer(playerid,"~y~Khoshoomadi Be ~n~~b~Derby Deathmatch", 2000, 3);
SetPlayerPos(playerid, -1356.5100, 932.1922, 1036.1119);
SetPlayerInterior(playerid, 15);
SetPlayerVirtualWorld(playerid, 15);
bloodring_id[playerid] = CreateVehicle(504, -1356.5100, 932.1922, 1036.1119, 0.0, 0, 0, -1);
LinkVehicleToInterior(bloodring_id[playerid], 15);
SetVehicleVirtualWorld(bloodring_id[playerid], 15);
PutPlayerInVehicle(playerid, bloodring_id[playerid], 0);
SetVehicleParamsEx(bloodring_id[playerid], engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);
SetTimerEx("LockCar",120000,false,"i",playerid);
SetPlayerHealth(playerid, 100);
}
return 1;
}
forward LockCar(playerid);
public LockCar(playerid)
{
if(DerbyNumber >= 2)
{
SetTimerEx("Count",100,false,"ii",playerid,3);
}
return 1;
}
forward Count(playerid,time);
public Count(playerid,time)
{
if(time != 0)
{
new string[5];
format(string, sizeof(string), "%d", time);
GameTextForPlayer(playerid, string, 1000, 5);
}
else
{
GameTextForPlayer(playerid, "GO!", 2500, 3);
SetVehicleParamsEx(bloodring_id[playerid], engine, lights, alarm, VEHICLE_PARAMS_OFF, bonnet, boot, objective);
}
return 1;
}
Re: Lock Car For 2 Minutes +Rep for True Code -
Ramin - 07.01.2017
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (5901) : error 017: undefined symbol "engine"
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (609

: error 017: undefined symbol "engine"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Please Help To Fix Problem <3
2 Errors.
Re: Lock Car For 2 Minutes +Rep for True Code -
StrikerZ - 07.01.2017
PHP код:
new bloodring_id[MAX_PLAYERS], engine, alarm, lights, doors, bonnet, boot, objective;; // Make this as a global variable as this will be used in public functions
CMD:derby(playerid, params[])
{
if (My_Interior[playerid] == 15)
{
SendClientMessage(playerid,COLOR_BLUE,"Shoma Hamaknoon Dakhele Derby Hasti");
}
else if(DerbyNumber == 1)
{
DerbyNumber += 1;
My_Interior[playerid] = 15;
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "{6666FF}(/derby) {00CCFF}%s {6666FF}Teleport Shod Be Derby", pName);
SendClientMessageToAll(0xFFFFFFFF, string);
SendClientMessage(playerid,COLOR_RED,"Baraye Khoroj Az Derby Bezanid /leavederby");
GameTextForPlayer(playerid,"~y~Khoshoomadi Be ~n~~b~Derby Deathmatch", 2000, 3);
SetPlayerPos(playerid, -1356.5100, 932.1922, 1036.1119);
SetPlayerInterior(playerid, 15);
SetPlayerVirtualWorld(playerid, 15);
bloodring_id[playerid] = CreateVehicle(504, -1356.5100, 932.1922, 1036.1119, 0.0, 0, 0, -1);
LinkVehicleToInterior(bloodring_id[playerid], 15);
SetVehicleVirtualWorld(bloodring_id[playerid], 15);
PutPlayerInVehicle(playerid, bloodring_id[playerid], 0);
GetVehicleParamsEx(bloodring_id[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(bloodring_id[playerid], engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);
SetTimerEx("LockCar",120000,false,"i",playerid);
SetPlayerHealth(playerid, 100);
}
return 1;
}
forward LockCar(playerid);
public LockCar(playerid)
{
if(DerbyNumber >= 2)
{
SetTimerEx("Count",100,false,"ii",playerid,3);
}
return 1;
}
forward Count(playerid,time);
public Count(playerid,time)
{
if(time != 0)
{
new string[5];
format(string, sizeof(string), "%d", time);
GameTextForPlayer(playerid, string, 1000, 5);
}
else
{
GameTextForPlayer(playerid, "GO!", 2500, 3);
SetVehicleParamsEx(bloodring_id[playerid], engine, lights, alarm, VEHICLE_PARAMS_OFF, bonnet, boot, objective);
}
return 1;
}
Re: Lock Car For 2 Minutes +Rep for True Code -
Ramin - 07.01.2017
Man i Relpaced your codes Errors All fixed But when i type /derby Nothing will happen
if you type /asdasdsa or /(anotheryouwant) SendClientMessage(playerid, "unkown command")
but in the /derby Is not it
Re: Lock Car For 2 Minutes +Rep for True Code -
StrikerZ - 07.01.2017
Debug the code. For ex
PHP код:
if (My_Interior[playerid] == 15)
{
SendClientMessage(playerid,COLOR_BLUE,"Shoma Hamaknoon Dakhele Derby Hasti");
printf("fail");
}
Like this. Then check your console. If the "Fail" is printed then the my_interior is on 15
Re: Lock Car For 2 Minutes +Rep for True Code -
Ramin - 07.01.2017
Very Thanks i finded the bug this not for it that's my falt <3