Upomoc...:D

Započeo Sponzo, April 16, 2010, 21:42:57 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Kako da napravim komandu s kojom mogu zakljucati auto pod odredenim id-om?



virtuozo


Imam 1 problem s /lock pise SERVER:Unknown Command
I dali to ostane i poslije reloga i /gmx-a?



Funky

Mozda nemas lock komandu evo ti ju pa ju ubaci!
To ubaci ispod PublicOnGameMode Init
//----------------------------------[LOCK]-----------------------------------------------
if(strcmp(cmd, "/lock", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
new carid;
if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
{
if(gLastCar[playerid] == 0 && PlayerInfo[playerid][pPhousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Niste u vozilu.");
return 1;
}
else if(gLastCar[playerid] != 0 && gLastCar[playerid] != PlayerInfo[playerid][pPhousekey]+1)
{
if (HireCar[playerid] != gLastCar[playerid] && HireCar[playerid] != 299)
{
gLastDriver[HireCar[playerid]] = 300;
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
}
HireCar[playerid] = gLastCar[playerid];
}
}
if (PlayerInfo[playerid][pPhousekey] == 255)
{
if(HireCar[playerid] == 299)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate vozilo.");
return 1;
}
}
carid = PlayerInfo[playerid][pPhousekey]+1;
if(HireCar[playerid] != 299 && !SwitchKey[playerid])
{
carid = HireCar[playerid];
}
//new driver = gLastDriver[carid];
new lockstatus = gCarLock[carid];
new Float:cx,Float:cy,Float:cz;
GetVehiclePos(carid, cx, cy, cz);
switch (lockstatus)
{
case 0:
{
if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate vozilo");
return 1;
}
if(HireCar[playerid] == carid && !SwitchKey[playerid])
{
GameTextForPlayer(playerid, "~w~Trenutno vozilo ~r~Zakljucano", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 1;
LockCar(carid);
}
else if (PlayerInfo[playerid][pPhousekey] == carid-1)
{
GameTextForPlayer(playerid, "~w~Kucno vozilo ~r~Zakljucano", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 1;
LockCar(carid);
return 1;
}
}
case 1:
{
if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate vozilo");
return 1;
}
if(HireCar[playerid] == carid && !SwitchKey[playerid])
{
GameTextForPlayer(playerid, "~w~Trenutno vozilo ~g~Otkljucano", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 0;
UnLockCar(carid);
}
if (PlayerInfo[playerid][pPhousekey] == carid-1)
{
GameTextForPlayer(playerid, "~w~Kucno vozilo ~g~Otkljucano", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 0;
UnLockCar(carid);
return 1;
}
}
default:
{
SendClientMessage(playerid, COLOR_GRAD2, "   PogreÅ¡ka");
}
}
if(carid == 256)
{
SendClientMessage(playerid, COLOR_GRAD2, "  Nemate vozilo !");
}
}
return 1;
}


Ne radi opet...I jel ne ide pod OnPlayerCommand?



Citat: Sponzo poslato April 16, 2010, 23:25:36 POSLE PODNE
Ne radi opet...I jel ne ide pod OnPlayerCommand?

Koja rijeka tece ispod dravskog mosta?? :o Pa ako pise onplayerCOMMAND logicno je da ide... :D
Mysterious roleplay

A jbt...Ubacio sam tamo...Ne radi pise kucno vozilo odkljucano/zakljucano,ali ja neam kucne aute u modu,,,,A kad hirecar i onda lock pise SERVER:Unknown Command...I ja znam di treba ic al je ovaj gore stavio OngameModeinit...Nisam toliki low da neznam di idu commande! >:(



iYoko

Ali si dovoljni low da nemozes skuzit zašto ti neradi /lock?

Zasto?Pa house car lock nemoze radit kad neam kucne aute u GM-u al Hire Car bi trebalo al mi izbaci SERVER:Unknown command