SA-MP Forums Archive
Problem with sscanf - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Problem with sscanf (/showthread.php?tid=294683)



Problem with sscanf - Hellman92 - 02.11.2011

now i have move my hoster from home host to volt-host now i get problem had problems with some command such as this

yes have sscanf plugin

help me get + rep

pawn Код:
COMMAND:gethere(playerid, params[])
{
    new iPlayerID; // The player we want to teleport to us
    new Float:posX, Float:posY, Float:posZ;
   
    ///////////////////////////////////////////
    ///////////ADMINCHECK/////////////////////
    if(!AdminCheck(playerid, ADMINLEVEL_MODERATOR))
        return 1;
    /////////////////////////////////////////
    /////////////////////////////////////////
    if(sscanf(params, "u", iPlayerID)) // If the player hasn't submitted the parameter "user"
    {
        return SendClientMessage(playerid,COLOR_GREY,"Usage: /gethere [PlayerID/PartOfName]");
    }

    if(IsPlayerInAnyVehicle(iPlayerID) && GetPlayerState(iPlayerID) == PLAYER_STATE_DRIVER) // Is the player currently inside a vehicle?
    {
        if(GetPlayerInterior(playerid) != 0) // If so, is the admin teleporting him inside an interior?
        {
            return SendClientMessage(playerid,COLOR_GREY,"You can't teleport a vehicle into an interior!");
        }

        ////////////////////////////////////////VARIABLES////////////////////////////////////
        new szMessage[23+1+MAX_PLAYER_NAME]; // String to contain the success-message
        new iVehicleID = GetPlayerVehicleID(iPlayerID);
        /////////////////////////////////////////////////////////////////////////////////////

        GetPlayerPos(playerid, posX, posY, posZ); // Get our players position
        SetVehiclePos(iVehicleID, posX+5, posY, posZ); // Teleport the vehicle
        SetPlayerInterior(iPlayerID, GetPlayerInterior(playerid)); // Just in case something goes wrong
        SetPlayerVirtualWorld(iPlayerID, GetPlayerVirtualWorld(playerid)); // Set the players virtual world
        SetVehicleVirtualWorld(iVehicleID, GetPlayerVirtualWorld(playerid)); // Set the vehicles virtual world

        format(szMessage, 23+1+MAX_PLAYER_NAME,"You teleported %s to you!", ReturnPlayerName(iPlayerID));
        SendClientMessage(playerid,COLOR_WHITE,szMessage);
    }
    else
    {
        new szMessage[23+1+MAX_PLAYER_NAME]; // String to contain the success-message

        GetPlayerPos(playerid, posX, posY, posZ); // Get our players position
        SetPlayerPos(iPlayerID, posX, posY, posZ);
        SetPlayerInterior(iPlayerID, GetPlayerInterior(playerid));
        SetPlayerVirtualWorld(iPlayerID, GetPlayerVirtualWorld(playerid));

        format(szMessage, 23+1+MAX_PLAYER_NAME,"You teleported %s to you!", ReturnPlayerName(iPlayerID));
        SendClientMessage(playerid,COLOR_WHITE,szMessage);
    }
    return 1;
}
but this command work but i think this are same command system

pawn Код:
COMMAND:commands(playerid, params[])
{
    SendClientMessage(playerid,COLOR_WHITE,"- http://www.ibp-rp.com [Command List]");
    SendClientMessage(playerid, COLOR_GRAD2, "[General] /stats /time /admins /changepass /spawnpoint /charity /anim");
    SendClientMessage(playerid, COLOR_GRAD2, "[General] /dropgun /pgun  /showid /id /accept /pay /re(port) /toggle");
    SendClientMessage(playerid, COLOR_GRAD2, "[General] /engine /refuel /eject /tie /untie /frisk /searchwallet ");
    SendClientMessage(playerid, COLOR_GRAD2, "[General] /bail /dice /coin /detonatebomb /seatbelt /clearanims");
    SendClientMessage(playerid, COLOR_GRAD2, "[General] /blindfold /unblindfold /lock /askq /calllist /trunk");
    SendClientMessage(playerid, COLOR_GRAD2, "[General] /inventory /id /lock /vehicle  /give /setstat /testers");
    SendClientMessage(playerid, COLOR_GRAD2, "[General] /buy /buygun /buydrink /askq /eatfood /drug /house /v");
    SendClientMessage(playerid, COLOR_GRAD2, "[General] /housecmds /businesscmds /jobcmds /chatcmds /notecmds");
    SendClientMessage(playerid, COLOR_GRAD2, "[General] /bankcmds /phonecmds /quitjob");
   
    switch(PlayerInfo[playerid][pFaction])
    {
        case 1:
        {
            return SendClientMessage(playerid,COLOR_GRAD2,"[Police] /p(olice)cmds");
        }
        case 2:
        {
            return SendClientMessage(playerid, COLOR_GRAD2, "[LS-EMS] /mcmds");
        }
        case 3:
        {
            return SendClientMessage(playerid, COLOR_GRAD2, "[Sheriff] /pcmds");
        }
        case 4:
        {
            return SendClientMessage(playerid, COLOR_GRAD2, "[SAN News] /newscmds");
        }
    }
   
    if(PlayerInfo[playerid][pRank] == 1)
    {
        return SendClientMessage(playerid, COLOR_GRAD2, "[Leader] /leadercmds");
    }
   
    if(PlayerInfo[playerid][pAdministrator] >= 1)
    {
        return SendClientMessage(playerid, COLOR_GRAD2, "[Admin] /acmds");
    }
   
    return 1;
}



Re: Problem with sscanf - Chicken0895 - 03.11.2011

I can see that the second command does not use scanff. Volt host uses linux, so you put the .so plugin and not the dll right?


Re: Problem with sscanf - Kerlan - 04.11.2011

What GM are you using?


Re: Problem with sscanf - =WoR=G4M3Ov3r - 04.11.2011

Volt-Host uses One Click Mod Installer, use it to install sscanf, if you upload yours, it won't work. After that, open your server.cfg and do the following

plugins sscanf2.so