SA-MP Forums Archive
/givecar command help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /givecar command help (/showthread.php?tid=395080)



/givecar command help - geohareas - 25.11.2012

Hello guys,i need your help.I found this command:
Код:
CMD:givecar(playerid,params[]) { 
    if(PlayerInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid)) { 
        if(isnull(params)) return SendClientMessage(playerid,red,"USAGE: /givecar [playerid]"); 
        new player1 = strval(params), playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; 
        if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin"); 
     if(IsPlayerInAnyVehicle(player1)) return SendClientMessage(playerid,red,"ERROR: Player already has a vehicle"); 
         if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) { 
            CMDMessageToAdmins(playerid,"GIVECAR"); 
            new Float:x, Float:y, Float:z;    GetPlayerPos(player1,x,y,z); 
            CarSpawner(player1,415); 
            GetPlayerName(player1, playername, sizeof(playername));        GetPlayerName(playerid, adminname, sizeof(adminname)); 
            format(string,sizeof(string),"Administrator %s has given you a car",adminname);    SendClientMessage(player1,blue,string); 
            format(string,sizeof(string),"You have given %s a car", playername); return SendClientMessage(playerid,blue,string); 
        } else return SendClientMessage(playerid, red, "Player is not connected or is yourself"); 
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); 
}
But everytime I give a car to a player,the car is not saved,and when he logs off it disappear!I need a command,giving him pernamently a car,making him the owner of it!

I really appreciate that you read my post,and i want to thank you in advance,hope to hear from you soon!


Re: /givecar command help - geohareas - 25.11.2012

none?