BIG PAWNO PROBLEM!! --->>> PLEASE READ <----------
#1

Hi guys lately i was making a DM script and i wanted to make so that if a player writes , /DM he tele's to the DM spot where i made it , thats fine i know how to do that but I wanna make so that when the player write /DMQ to quite from the Deathmatch , he gets all his weapons back and into his position where he entered /DM plz help me heres the pawn code i did so far

Код:
if(strcmp(cmdtext,"/DM",true) == 0)
	{
	    SendClientMessage(playerid, COLOR_RED, "You have joined the Deathmatch");
	    SetPlayerPos(playerid, -4078.3999023438,-449.10000610352,37.200000762939);
	    SetPlayerFacingAngle(playerid , 1);
		GivePlayerWeapon(playerid, 26,9999);
		SetPlayerInterior(playerid, 0);
        new string[256], pname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pname, sizeof(pname));
		format(string, sizeof(string), "-Deathmatch Info- %s Wlasnie Dolaczyl do DeathMatcha! (/DM) ", pname);
		SendClientMessageToAll(COLOR_GOLD, string);
        new Float:x, Float:y, Float:z;
   		GetPlayerPos(playerid, x, y, z);
		return 1;
	        }
	        
        if(strcmp(cmdtext,"/DMQ",true) == 0)
	{
	    return 1;
	        }

I wanna make so that when the player does /DMQ he gets back to his old position where he type /DM , and so that he would get his weps back plz help
Reply
#2

You need to save a player's weapons in his file or something and when he leaves the DM zone you need to give it back to him.
Reply
#3

ok to save tha players pos when he types /dm put this
pawn Код:
//at the top
new Float:SavedPosX[MAX_PLAYERS],Float:SavedPosY[MAX_PLAYERS],Float:SavedPosZ[MAX_PLAYERS],Float:SavedPosA[MAX_PLAYERS];

//then the cmd
if(strcmp(cmdtext,"/DM",true) == 0)
{
GetPlayerPos(playerid, SavedPosX[playerid], SavedPosY[playerid], SavedPosZ[playerid]);
GetPlayerFacingAngle(playerid, SavedPosA[playerid]);
//So on with the code....
then to load it just do
pawn Код:
//at your /QDM cmds
SetPlayerPos(playerid, SavedPosX[playerid], SavedPosY[playerid], SavedPosZ[playerid]);
SetPlayerFacingAngle(playerid, SavedPosA[playerid]);
Reply
#4

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
ok to save tha players pos when he types /dm put this
pawn Код:
//at the top
new Float:SavedPosX[MAX_PLAYERS],Float:SavedPosY[MAX_PLAYERS],Float:SavedPosZ[MAX_PLAYERS],Float:SavedPosA[MAX_PLAYERS];

//then the cmd
if(strcmp(cmdtext,"/DM",true) == 0)
{
GetPlayerPos(playerid, SavedPosX[playerid], SavedPosY[playerid], SavedPosZ[playerid]);
GetPlayerFacingAngle(playerid, SavedPosA[playerid]);
//So on with the code....
then to load it just do
pawn Код:
//at your /QDM cmds
SetPlayerPos(playerid, SavedPosX[playerid], SavedPosY[playerid], SavedPosZ[playerid]);
SetPlayerFacingAngle(playerid, SavedPosA[playerid]);
Didnt just work , i pasted all that you gave me under /DM , and yes i put the thing u told me to put on the top, I Compiled at it worked but when i pasted the code for /DMQ error plz help
Reply
#5

Quote:
Originally Posted by nateykurgan
Посмотреть сообщение
Didnt just work , i pasted all that you gave me under /DM , and yes i put the thing u told me to put on the top, I Compiled at it worked but when i pasted the code for /DMQ error plz help
state what the error was ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)