Jump to content
  • 0

Problema odometer si /goto


DoDy

Question

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;
}

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
  • 0

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;
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.