Lock Car For 2 Minutes +Rep for True Code
#1

I Need Help For Lock Car 2 minutes
PHP код:
CMD:derby(playeridparams[])
{
    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_idstring[128], pName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
        
format(stringsizeof(string), "{6666FF}(/derby) {00CCFF}%s {6666FF}Teleport Shod Be Derby"pName);
        
SendClientMessageToAll(0xFFFFFFFFstring);
    
SendClientMessage(playerid,COLOR_RED,"Baraye Khoroj Az Derby Bezanid /leavederby");
        
GameTextForPlayer(playerid,"~y~Khoshoomadi Be ~n~~b~Derby Deathmatch"20003);
        
SetPlayerPos(playerid, -1356.5100932.19221036.1119);
        
SetPlayerInterior(playerid15);
        
SetPlayerVirtualWorld(playerid15);
        
bloodring_id CreateVehicle(504, -1356.5100932.19221036.11190.000, -1);
        
LinkVehicleToInterior(bloodring_id15);
        
SetVehicleVirtualWorld(bloodring_id15);
        
PutPlayerInVehicle(playeridbloodring_id0);
        
SetPlayerHealth(playerid100);
        
/* 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*/ 
    
}

Reply
#2

PHP код:
new bloodring_id[MAX_PLAYERS]; // Make this as a global variable as this will be used in public functions

CMD:derby(playeridparams[])
{
    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(playeridpNameMAX_PLAYER_NAME);
        
format(stringsizeof(string), "{6666FF}(/derby) {00CCFF}%s {6666FF}Teleport Shod Be Derby"pName);
        
SendClientMessageToAll(0xFFFFFFFFstring);
        
SendClientMessage(playerid,COLOR_RED,"Baraye Khoroj Az Derby Bezanid /leavederby");
        
GameTextForPlayer(playerid,"~y~Khoshoomadi Be ~n~~b~Derby Deathmatch"20003);
        
SetPlayerPos(playerid, -1356.5100932.19221036.1119);
        
SetPlayerInterior(playerid15);
        
SetPlayerVirtualWorld(playerid15);
        
bloodring_id[playerid] = CreateVehicle(504, -1356.5100932.19221036.11190.000, -1);
        
LinkVehicleToInterior(bloodring_id[playerid], 15);
        
SetVehicleVirtualWorld(bloodring_id[playerid], 15);
        
PutPlayerInVehicle(playeridbloodring_id[playerid], 0);
        
SetVehicleParamsEx(bloodring_id[playerid], enginelightsalarmVEHICLE_PARAMS_ONbonnetbootobjective);
        
SetTimerEx("LockCar",120000,false,"i",playerid);
        
SetPlayerHealth(playerid100);
    }
    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(stringsizeof(string), "%d"time);
        
GameTextForPlayer(playeridstring10005);
    }
    else
    {
        
GameTextForPlayer(playerid"GO!"25003);
        
SetVehicleParamsEx(bloodring_id[playerid], enginelightsalarmVEHICLE_PARAMS_OFFbonnetbootobjective);
    }
    return 
1;

Reply
#3

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.
Reply
#4

PHP код:
new bloodring_id[MAX_PLAYERS], enginealarmlightsdoorsbonnetbootobjective;; // Make this as a global variable as this will be used in public functions
CMD:derby(playeridparams[])
{
    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(playeridpNameMAX_PLAYER_NAME);
        
format(stringsizeof(string), "{6666FF}(/derby) {00CCFF}%s {6666FF}Teleport Shod Be Derby"pName);
        
SendClientMessageToAll(0xFFFFFFFFstring);
        
SendClientMessage(playerid,COLOR_RED,"Baraye Khoroj Az Derby Bezanid /leavederby");
        
GameTextForPlayer(playerid,"~y~Khoshoomadi Be ~n~~b~Derby Deathmatch"20003);
        
SetPlayerPos(playerid, -1356.5100932.19221036.1119);
        
SetPlayerInterior(playerid15);
        
SetPlayerVirtualWorld(playerid15);
        
bloodring_id[playerid] = CreateVehicle(504, -1356.5100932.19221036.11190.000, -1);
        
LinkVehicleToInterior(bloodring_id[playerid], 15);
        
SetVehicleVirtualWorld(bloodring_id[playerid], 15);
        
PutPlayerInVehicle(playeridbloodring_id[playerid], 0);
        
GetVehicleParamsEx(bloodring_id[playerid], enginelightsalarmdoorsbonnetbootobjective);
        
SetVehicleParamsEx(bloodring_id[playerid], enginelightsalarmVEHICLE_PARAMS_ONbonnetbootobjective);
        
SetTimerEx("LockCar",120000,false,"i",playerid);
        
SetPlayerHealth(playerid100);
    }
    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(stringsizeof(string), "%d"time);
        
GameTextForPlayer(playeridstring10005);
    }
    else
    {
        
GameTextForPlayer(playerid"GO!"25003);
        
SetVehicleParamsEx(bloodring_id[playerid], enginelightsalarmVEHICLE_PARAMS_OFFbonnetbootobjective);
    }
    return 
1;

Reply
#5

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
Reply
#6

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
Reply
#7

Very Thanks i finded the bug this not for it that's my falt <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)