SA-MP Forums Archive
SetPlayer Object/Target ID problem - 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: SetPlayer Object/Target ID problem (/showthread.php?tid=550474)



nothing - Samjoc18 - 13.12.2014

SOLVED


Re: SetPlayer Object/Target ID problem - astanalol - 13.12.2014

Try This
PHP код:
CMD:setobject(playeridparams[])
{
    if (
AccountInfo[playerid][Aadmin] >= 3)
    {
    new 
string[128];
    new 
tname[MAX_PLAYER_NAME];
    new 
targetid;
        if (
sscanf(params"ui"targetid))
        {
            
SendClientMessage(playeridCOLOR_WHITE"USAGE: /setobject [playerid]");
            return 
1;
        }
        if (
targetid != INVALID_PLAYER_ID)
        {
            
GetPlayerName(targetidtnamesizeof(tname));
            
format(stringsizeof(string), "%s has been set an object"tname);
            
SendClientMessageToAll(COLOR_YELLOWstring);
            
SetPlayerAttachedObject(targetid219142,  10.1,  0.050.0,  0.0,   0.0,   0.0);
            
SetPlayerAttachedObject(targetid319141,  20.110.0,  0.0,  0.0,   0.0,   0.0);
            
SetPlayerAttachedObject(targetid418637130.350.0,  0.0,  0.0,   0.0180.0);
            
SetPlayerAttachedObject(targetid518642,  70.1,  0.0, -0.110.0, -90.0,  90.0);
         
        }
        else 
SendClientMessage(playeridCOLOR_RED"Invalid Player!");
    }
    else 
SendClientMessage(playeridCOLOR_RED"You can't access this command");
    return 
1;




Re: SetPlayer Object/Target ID problem - Samjoc18 - 13.12.2014

Thanks for the help... but doesn't work
it just returns "USAGE: /setobject [playerid]" all the time


AW: SetPlayer Object/Target ID problem - rospar - 13.12.2014

This Line is Wrong it contains i but u just need u:
Код:
if (sscanf(params, "ui", targetid))
Код:
CMD:setobject(playerid, params[])
{
    if (AccountInfo[playerid][Aadmin] < 3) return SendClientMessage(playerid, COLOR_RED, "You can't access this command");
    new string[100];
    new tname[24];
    new targetid;
	if (sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setobject [playerid]");
	if (targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid Player!");
	GetPlayerName(targetid, tname, sizeof(tname));
	format(string, sizeof(string), "%s has been set an object", tname);
	SendClientMessageToAll(COLOR_YELLOW, string);
	SetPlayerAttachedObject(targetid, 2, 19142,  1, 0.1,  0.05, 0.0,  0.0,   0.0,   0.0);
	SetPlayerAttachedObject(targetid, 3, 19141,  2, 0.11, 0.0,  0.0,  0.0,   0.0,   0.0);
	SetPlayerAttachedObject(targetid, 4, 18637, 13, 0.35, 0.0,  0.0,  0.0,   0.0, 180.0);
	SetPlayerAttachedObject(targetid, 5, 18642,  7, 0.1,  0.0, -0.11, 0.0, -90.0,  90.0);
    return 1;
}



Re: SetPlayer Object/Target ID problem - Samjoc18 - 13.12.2014

afgg


Re: SetPlayer Object/Target ID problem - Samjoc18 - 14.12.2014

anyone knows solution? sometimes randomly it only works for 1 player