Function Problem ??
#1

Hi Guys I made I function SetPosToPlayer(playerid,giveid) but on use it gives me this error:

Error :
pawn Код:
error 035: argument type mismatch (argument 2)
By code Also try public SetPosToPlayer(playerid,giveid);
pawn Код:
stock SetPosToPlayer(playerid,giveid)
        {
        new Float:gx,Float:gy,Float:gz;
        GetPlayerPos(giveid, gx, gy, gz);
        SetPlayerPos(playerid,gx,gy+2, gz);
        return 1;
    }

CMD:

CMD:goto(playerid, params[])
    {
        new giveid[MAX_PLAYERS];
        if(sscanf(params,"d",giveid)) return SendClientMessage(playerid,USAGE,"Usage : /goto <playerid>");
        else {
        SetPosToPlayer(playerid,giveid);//Error is in this line }
        return 1;
 }
I want to make this Function.
Reply
#2

pawn Код:
stock SetPosToPlayer(playerid,giveid)
{
    new Float:gx,Float:gy,Float:gz;
    GetPlayerPos(giveid, gx, gy, gz);
    SetPlayerPos(playerid,gx,gy+2, gz);
    return 1;
}
re-placed ur braces, compiles sucesfully for me
else idk
and umm, what does this CMD: [nothing here] does there?? remove that
So full code would be
pawn Код:
stock SetPosToPlayer(playerid,giveid)
{
        new Float:gx,Float:gy,Float:gz;
        GetPlayerPos(giveid, gx, gy, gz);
        SetPlayerPos(playerid,gx,gy+2, gz);
        return 1;
}


CMD:goto(playerid, params[])
{
        new giveid[MAX_PLAYERS];
        if(sscanf(params,"d",giveid)) return SendClientMessage(playerid,USAGE,"Usage : /goto <playerid>");
        else {
        SetPosToPlayer(playerid,giveid);//Error is in this line }
        return 1;
}
Reply
#3

Same error again
Reply
#4

Delete this [MAX_PLAYERS]
Reply
#5

Ye I make /goto car and function in same way and its work but this one is not working ? ? ? ?? ? ? ?
Reply
#6

Quote:
Originally Posted by webninjasi
Посмотреть сообщение
Delete this [MAX_PLAYERS]
Ye Thanks Works I del before watching you comment.....

SOLVED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)