Please, SA-MP community, if I could have a minute of your time.
#10

Will give you an example with zcmd and sscanf...

pawn Код:
CMD:setvw(playerid, params[])
{
    new id, vw;
    if(!sscanf(params, "ui", id, vw))
    {
        new string[128], Name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name, sizeof(Name));
        GetPlayerName(id, PlayerName, sizeof(PlayerName));
        format(string, sizeof(string), "You setted %s Virtual World to %d.", PlayerName, vw);
        SendClientMessage(playerid, 0xFFFFFFFF, string);
        format(string, sizeof(string), "Administrator %s setted your Virtual World to %d.", Name, vw);
        SendClientMessage(id, 0xFFFFFFFF, string);
        SetPlayerInterior(id, vw);
        return 1;
    }
    else return SendClientMessage(playerid, COLOR_DARKGOLD, "USAGE: /setvw [PlayerID/PartOfName] [Virtual World ID]");
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)