Destroy all player objects
#1

Well, i made a /createplayerobject command but i have some problems; here is the code:
Код:
if(strcmp(cmd, "/cpo", true) == 0)
	{
	new Float:x, Float:y, Float:z;
	GetPlayerPos(id,x,y,z);
	new tmp[128];
	tmp = strtok(cmdtext, idx);
	if(strlen(tmp) == 0) return 1;
	CreatePlayerObject(playerid,strval(tmp),x,y+5,z,0,0,0);
	SetPVarInt(id,"dlpo",1);
	return 1;
	}
	if(strcmp(cmd, "/destlpo", true) == 0)
	{
	if(GetPVarInt(playerid,"dlpo") == 0) return 1;
	DestroyPlayerObject(playerid,lpo);
	GameTextForPlayer(playerid,"~y~Last player object destroyed!",3000,3);
	SendClientMessage(id,yellow,"Last player object deleted!");
	SetPVarInt(id,"dlpo",0);
	return 1;
	}
Is there any way to make the object in-frond of the player?
Reply
#2

Why does your topic title have no relevance to your topic whatsoever..? Imagine someone posting an advertisement saying 'I'M SELLING A CAR' then you find out they're selling a chicken. It's stupid.

pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if (GetPlayerVehicleID(playerid))
    {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
Why does your topic title have no relevance to your topic whatsoever..? Imagine someone posting an advertisement saying 'I'M SELLING A CAR' then you find out they're selling a chicken. It's stupid.

pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if (GetPlayerVehicleID(playerid))
    {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
LOL! That was kind of funny. :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)