Destroy all player objects - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Destroy all player objects (
/showthread.php?tid=386713)
Destroy all player objects -
mike_1 - 21.10.2012
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?
Re: Destroy all player objects -
MP2 - 22.10.2012
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));
}
Re: Destroy all player objects -
zDivine - 22.10.2012
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