GetPlayerPos - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetPlayerPos (
/showthread.php?tid=256622)
GetPlayerPos -
PhantomDot1 - 21.05.2011
with GetPlayerPos you allways use like this:
Code:
GetPlayerPos(playerid, x, y, z);
but if i want to get the playerposition from the playerid i enter in the command /destroy
this is the code :
Code:
dcmd_destroy(playerid, params[])
{
new Float:x, Float:y, Float:z;
#pragma unused params
if(!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 0xAA3333AA, "this command is for admins only");
}
if(IsPlayerAdmin(playerid))
{
GetPlayerPos(playerid, x, y, z);
CreateExplosion(x, y, z, 7, 10.0);
CreateExplosion(x, y, z, 7, 10.0);
}
return 1;
}
Please Help me !!!!!!!
Re: GetPlayerPos -
iJumbo - 21.05.2011
and what you need?
you want make /destroy [ID] ??
Re: GetPlayerPos -
KoczkaHUN - 21.05.2011
pawn Code:
dcmd_destroy(playerid, params[])
{
new Float:x, Float:y, Float:z, victim;
if(!IsPlayerAdmin(playerid))
{
return SendClientMessage(playerid, 0xAA3333AA, "this command is for admins only");
}
if(params[0] == 0)
{
return SendClientMessage(playerid, 0xAA3333AA, "usage: /destroy [victim id]");
}
victim = strval(params);
if(!IsPlayerConnected(victim))
{
return SendClientMessage(playerid, 0xAA3333AA, "that player is not available!");
}
GetPlayerPos(victim, x, y, z);
CreateExplosion(x, y, z, 7, 10.0);
CreateExplosion(x, y, z, 7, 10.0);
return 1;
}
Re: GetPlayerPos -
iJumbo - 21.05.2011
Do some like this
pawn Code:
dcmd_destroy(playerid, params[])
{
new id,Float:x,Float:y,Float:z;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xAA3333AA, "/destroy [ID / NAME]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xAA3333AA, "this command is for admins only");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xAA3333AA, "This Player is offline");
GetPlayerPos(id, x, y, z);
CreateExplosion(x, y, z, 7, 10.0);
CreateExplosion(x, y, z, 7, 10.0);
return 1;
}
with sscanf
Re: GetPlayerPos -
KoczkaHUN - 21.05.2011
if you want to get exactly one variable, you don't need a whole server plugin (sscanf)
Re: GetPlayerPos -
iJumbo - 21.05.2011
he can change it easly
every one has a method of script