GetPlayerPos
#1

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 !!!!!!!
Reply
#2

and what you need?



you want make /destroy [ID] ??
Reply
#3

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;
}
Reply
#4

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
Reply
#5

if you want to get exactly one variable, you don't need a whole server plugin (sscanf)
Reply
#6

he can change it easly

every one has a method of script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)