Mod koji koristim: Ravens GM
Dje zapelo: problem je kada zakljucam auto on nije zakljucan a ne kontam zasto mogu uci ako zakljuicam auto i kaze da je zakljucan i kao sve je ok ali u auto se moze uci
Deo Skripte: else if(strcmp(x_nr,"lock",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey];
if(keycar != 9999)
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(keycar,X,Y,Z);
if(IsPlayerInRangeOfPoint(playerid, 25,X,Y,Z))
{
new locked[128];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate(4,keycar);
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate(4,keycar);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY,"* You must be Near or in Your car to lock it!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* You don't have a vehicle at slot 1");
return 1;
}
}
else if(strcmp(x_nr,"lock2",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey2];
if(keycar != 9999)
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(keycar,X,Y,Z);
if(IsPlayerInRangeOfPoint(playerid, 25,X,Y,Z))
{
new locked[128];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate(4,keycar);
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate(4,keycar);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY,"* You must be Near or in Your car to lock it!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 2");
return 1;
}
}
else if(strcmp(x_nr,"lock3",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey3];
if(keycar != 9999)
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(keycar,X,Y,Z);
if(IsPlayerInRangeOfPoint(playerid, 25,X,Y,Z))
{
new locked[128];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate(4,keycar);
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate(4,keycar);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY,"* You must be Near or in Your car to lock it!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 2");
return 1;
}
}
Radi hvala ti puno,jel mi mozes reci samo zbog cega su mi ovi warninzi?
C:\Users\Internet\Desktop\Europe RolePlay\gamemodes\larp.pwn(36701) : warning 202: number of arguments does not match definition
C:\Users\Internet\Desktop\Europe RolePlay\gamemodes\larp.pwn(36716) : warning 202: number of arguments does not match definition
C:\Users\Internet\Desktop\Europe RolePlay\gamemodes\larp.pwn(36745) : warning 202: number of arguments does not match definition
C:\Users\Internet\Desktop\Europe RolePlay\gamemodes\larp.pwn(36760) : warning 202: number of arguments does not match definition
C:\Users\Internet\Desktop\Europe RolePlay\gamemodes\larp.pwn(36789) : warning 202: number of arguments does not match definition
C:\Users\Internet\Desktop\Europe RolePlay\gamemodes\larp.pwn(36804) : warning 202: number of arguments does not match definition
C:\Users\Internet\Desktop\Europe RolePlay\gamemodes\larp.pwn(36883) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
7 Warnings.
Linija: 36716 - OnPropUpdate(4);
Linija: 36745 - OnPropUpdate(4);
Linija: 36760 - OnPropUpdate(4);
Linija: 36789 - OnPropUpdate(4);
Linija: 36804 - OnPropUpdate(4);
Linija: 36883 - prazno polje
Deo skripte: else if(strcmp(x_nr,"lock",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey];
if(keycar != 9999)
{
new locked[128];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~g~otkljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate(4);
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~r~Zakljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate(4);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTNEUTRALBLUE, " Nemate vozilo na slotu br. 1");
return 1;
}
}
else if(strcmp(x_nr,"lock2",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey2];
if(keycar != 9999)
{
new locked[128];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~g~Otkljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate(4);
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~r~Zakljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate(4);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTNEUTRALBLUE, " Nemate vozilo na slotu br. 2");
return 1;
}
}
else if(strcmp(x_nr,"lock3",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey2];
if(keycar != 9999)
{
new locked[128];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~g~Otkljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate(4);
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~r~Zakljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate(4);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTNEUTRALBLUE, " Nemate vozilo na slotu br. 3");
return 1;
}
}
Ajde postavi taj public/stock OnPropUpdate i forward ako je public
Stavi umjesto
OnPropUpdate(4);
Stavi
OnPropUpdate();