SetPlayer Object/Target ID problem
#1

SOLVED
Reply
#2

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;

Reply
#3

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

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

afgg
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)