ZCMD problems
#5

each ZCMD is a callback, so you need to declare each variable for usage, in this case, the TargetID:
pawn Code:
CMD:get(playerid, params[])
{
    new TargetID
    if(sscanf(params, "u", TargetID))
    {
        ShadInfoBoxForPlayer(playerid, "/get [playerid/name]");
        return 1;
    }
    if(!IsPlayerConnected(TargetID))
    {
        ShadInfoBoxForPlayer(playerid, "Player isnt online");
        return 1;
    }
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(TargetID, x+1, y+1, z);
    return 1;
}
its a good idea to spawn the other player at a slightly different coordinate. north east, 1 meter each, is fine i hope.
the next step would ne checking if the TargetID is in any vehicle, and depending on being in a vehicle or not, get the TargetID or the vehicle the TargetID sits in..
the "c" specifier is a charcter. you need a "s" string:
pawn Code:
CMD:toall(playerid, params[])
{
    new text[50]
    if(sscanf(params, "s[50]", text))
    {
        ShadInfoBoxForPlayer(playerid, "/toall [text]");
        return 1;
    }
    SendClientMessageToAll(RED, text);
    return 1;
}
Reply


Messages In This Thread
ZCMD problems - by lukas567 - 19.03.2012, 11:25
Re: ZCMD problems - by emokidx - 19.03.2012, 11:28
Re: ZCMD problems - by .:Kaos:. - 19.03.2012, 11:28
Re: ZCMD problems - by !LukniS! - 19.03.2012, 11:59
Re: ZCMD problems - by Babul - 19.03.2012, 12:34

Forum Jump:


Users browsing this thread: 4 Guest(s)