Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

Problema odometer si /goto


Question

Posted

Salut , am o problema la odometer , inregistreaza km la masini dupa restart toate masinile au 0.00 km , de ce ?

  TextDrawShowForPlayer(i, Odom);
                    format(str3,sizeof(str3),"Odometers: %.2f Km",CarInfo[OwnedVeh(vehicle)][cKM]);
                    TextDrawSetString(Odom, str3);
                }
            }
        }
    }
    return 1;
}

si la /goto pot da si playerii normali , nu doar adminii , de ce ?

CMD:goto(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
    {
        new id;
        if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /goto <Name/Playerid>");
        if(Spectate[id] != 255) return SCM(playerid,COLOR_WHITE,"{FFB870}This player use /recon.");
        {
            if(id != INVALID_PLAYER_ID)
            {
                new Float:ax,Float:ay,Float:az;
                GetPlayerPos(playerid,ax,ay,az);
                posxxx[playerid] = ax;
                posyyy[playerid] = ay;
                poszzz[playerid] = az;
                new Float:x, Float:y, Float:z;
                GetPlayerPos(id, x, y, z);
                new tmpcar = GetPlayerVehicleID(playerid);
                if (GetPlayerState(playerid) == 2)
                {
                    SetVehiclePos(tmpcar, x, y+4, z);
                }
                else
                {
                    SetPlayerPos(playerid,x,y+2, z);
                }
                SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
                SetPlayerInterior(playerid, GetPlayerInterior(id));
                if(InHouse[id] > 0)
                {
                    InHouse[playerid] = InHouse[id];
                }
                if(InHQ[id] > 0)
                {
                    InHQ[playerid] = InHQ[id];
                }
                if(InBussines[id] > 0)
                {
                    InBussines[playerid] = InBussines[id];
                }
                SendClientMessage(playerid, COLOR_GRAD1, "You have been teleported.");
            }
            else return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin/helper level isn't high enough to use this command.");
    }
    return 1;
}

 

4 answers to this question

Recommended Posts

  • 0
  • 0
Posted

La goto , modifica:

if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)

Cu:

if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pHelper] < 1)

 

  • 0
Posted

nu modifica ce a spus reflex... 

if(PlayerInfo[playerid][pAdmin] < 1 

Semnul <inseamna mai mic decat 1 deci toti playeri pot folosi comanda..

Spune ce gm ai poate te ajut eu

  • 0
Posted

Poftim comanda goto

CMD:goto(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(PlayerInfo[playerid][pAdmin] < 1 && !PlayerInfo[playerid][pHelper]) return  SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin/helper level isn't high enough to use this command.");
    new id;
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /goto <Name/Playerid>");
    if(Spectate[id] != 255) return SCM(playerid,COLOR_WHITE,"{FFB870}This player use /recon.");
    {
    	if(id != INVALID_PLAYER_ID)
     	{
		    new Float:ax,Float:ay,Float:az;
        	GetPlayerPos(playerid,ax,ay,az);
         	posxxx[playerid] = ax;
            posyyy[playerid] = ay;
	        poszzz[playerid] = az;
	        new Float:x, Float:y, Float:z;
	        GetPlayerPos(id, x, y, z);
	        new tmpcar = GetPlayerVehicleID(playerid);
	        if (GetPlayerState(playerid) == 2)
	        {
	      		SetVehiclePos(tmpcar, x, y+4, z);
	        }
	        else
	        {
	      		SetPlayerPos(playerid,x,y+2, z);
	        }
	        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
	        SetPlayerInterior(playerid, GetPlayerInterior(id));
	        if(InHouse[id] > 0)
	        {
	      		InHouse[playerid] = InHouse[id];
	        }
	        if(InHQ[id] > 0)
	        {
	      		InHQ[playerid] = InHQ[id];
	        }
	        if(InBussines[id] > 0)
	        {
	      		InBussines[playerid] = InBussines[id];
	        }
         	SendClientMessage(playerid, COLOR_GRAD1, "You have been teleported.");
      	}
      	else return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
	}
	return 1;
}

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.