[POMOC] /findhcar


Započeo Tommy., Septembar 05, 2010, 14:53:08 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Radim Komandu koja pronalazi kucni auto ako se zagubi =D i sada komanda je napravljena i radi ali kada nadem auto koji mi treba neugasi se chechpoint =S Pogledaje komandu i recite u cemu je problem Sretno  :-X

Komdan zgleda vako

Kod: c
if(strcmp(cmd,"/findhcar",true)==0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	new Float:x, Float:y, Float:z, house = PlayerInfo[playerid][pPhousekey], carid = PlayerInfo[playerid][pPhousekey]+1;
			GetPlayerName(playerid, playername, sizeof(playername));
			if (house != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
			{
   				GetVehiclePos(carid,x,y,z);
		    	SetPlayerCheckpoint(playerid,x,y,z,8.0);
				SendClientMessage(playerid,COLOR_RED,"Vas Kucni Auto Je Lociran!");
			}
			if(PlayerToPoint(8.0,playerid,x,y,z))
			{
			    SendClientMessage(playerid,COLOR_RED,"Uspijesno ste pronasli auto.");
			    SendClientMessage(playerid,COLOR_RED,"Lociranje Automobila je iskljuceno!");
	    		DisablePlayerCheckpoint(playerid);
			}
			else
			{
			    SendClientMessage(playerid,COLOR_RED,"Nemate Kucu!!");
			}
		}
		else
		{
		    SendClientMessage(playerid,COLOR_RED,"Niste Spojeni na Server!!");
		}
	}

Koristi OnPlayerEnterCheckpoint & dodaj neku var da je checkpoint aktivan ....

BTW : Na ovom tvom kodu .. CP ce nestat ako dodjes do tog auta i ponovo kucas /findhcar :D
Vikend je policija nas hvata,
vikend je ode cijela plata,
oko nas stvari ukradene,
sve smo dali na planove i sheme..
||||:=:=:=:=:=:=::=:=:=:=:=:=:=:THE IVEX:=:=:=:=:=:=:=:=:=::=:=:=:=:=:=::=:|||| 


PS: Ne saljite mi nikakve pm jer neodgovaram na njih! Ako trebate nes pitajte ove pr0 skriptere pa neka vam kazu!Hvala !

Citat: [ST]ivex â†' ♫ poslato Septembar 05, 2010, 15:13:57 POSLE PODNE
Koristi OnPlayerEnterCheckpoint & dodaj neku var da je checkpoint aktivan ....

BTW : Na ovom tvom kodu .. CP ce nestat ako dodjes do tog auta i ponovo kucas /findhcar :D

Hmm ako cu raditi onplayerentercheckpoint mroam napraviti kordineate tamo a tamo nemogu pisati x,y,z =S

ovo bi trebalo radit al nisam vec dugo radio sa GF-om, al mislim da ti ne treba ovaj check za ownera jer si to provjerio vec kod house!=255 jer kolko znam house je 255 samo kad ne ownas kucu a ti si dodatno provjeravo ime ownera sto nema smisla ako vec ima kljuc...
if(strcmp(cmd,"/findhcar",true)==0)  
{
    new 
	Float:x, 
	Float:y, 
	Float:z, 
	house = PlayerInfo[playerid][pPhousekey], 
	carid = PlayerInfo[playerid][pPhousekey]+1;  
    if(house != 255)  
    {   
	SetPlayerCheckpoint(playerid, x, y, z, 8.0);  
	SendClientMessage(playerid,COLOR_RED,"Vas Kucni Auto Je Lociran!");  
	SetPVarInt(playerid, "hcar_int", carid);
    } 
    else  
    {  
	SendClientMessage(playerid,COLOR_RED,"Nemate Kucu!!");  
    }
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    new
	vehid = GetPVarInt(playerid, "hcar_id");
    if(vehid) 
    {
	new
	    Float: x,
	    Float: y,
	    Float: z;
	if(GetVehiclePos(vehid, x, y, z) && PlayerToPoint(8.0, playerid, x, y, z)
	{
            SendClientMessage(playerid,COLOR_RED,"Uspijesno ste pronasli auto.");  
            SendClientMessage(playerid,COLOR_RED,"Lociranje Automobila je iskljuceno!");  
            DisablePlayerCheckpoint(playerid);
	    SetPVarInt(playerid, "hcar_id", 0);	
	}
    }
    return 1;
}

note: nije testirano niti komapjlirano, vjerovatno ima greske al sigurno je bolje od tvojeg kod kojeg si btw. u komandi /findhcar stavio else kod PlayerToPoint uglavnom. cijela komanda je krivo strukturirana i preporucam ti koristenje ZCMD.a

Citat: JoeBullet v2.1 poslato Septembar 05, 2010, 17:33:16 POSLE PODNE
ovo bi trebalo radit al nisam vec dugo radio sa GF-om, al mislim da ti ne treba ovaj check za ownera jer si to provjerio vec kod house!=255 jer kolko znam house je 255 samo kad ne ownas kucu a ti si dodatno provjeravo ime ownera sto nema smisla ako vec ima kljuc...
if(strcmp(cmd,"/findhcar",true)==0)  
{
    new 
	Float:x, 
	Float:y, 
	Float:z, 
	house = PlayerInfo[playerid][pPhousekey], 
	carid = PlayerInfo[playerid][pPhousekey]+1;  
    if(house != 255)  
    {   
	SetPlayerCheckpoint(playerid, x, y, z, 8.0);  
	SendClientMessage(playerid,COLOR_RED,"Vas Kucni Auto Je Lociran!");  
	SetPVarInt(playerid, "hcar_int", carid);
    } 
    else  
    {  
	SendClientMessage(playerid,COLOR_RED,"Nemate Kucu!!");  
    }
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    new
	vehid = GetPVarInt(playerid, "hcar_id");
    if(vehid) 
    {
	new
	    Float: x,
	    Float: y,
	    Float: z;
	if(GetVehiclePos(vehid, x, y, z) && PlayerToPoint(8.0, playerid, x, y, z)
	{
            SendClientMessage(playerid,COLOR_RED,"Uspijesno ste pronasli auto.");  
            SendClientMessage(playerid,COLOR_RED,"Lociranje Automobila je iskljuceno!");  
            DisablePlayerCheckpoint(playerid);
	    SetPVarInt(playerid, "hcar_id", 0);	
	}
    }
    return 1;
}

note: nije testirano niti komapjlirano, vjerovatno ima greske al sigurno je bolje od tvojeg kod kojeg si btw. u komandi /findhcar stavio else kod PlayerToPoint uglavnom. cijela komanda je krivo strukturirana i preporucam ti koristenje ZCMD.a

Ma netreba vec sam narpaivo ;D PS koristim ZCMD ali sad sam ovako jer bezveze radim