Help on 4 things.
#1

So basically I have 3 problems:

1- When I use chainsaw after a teleport , it stops working (?) My script has nothing to do with that I think, is it a bug that can be fixed?

2-When I make an interior teleport in for example world 2, how do I make a way iof me respawning there when I type /interior1 ? And how do I get out of that world? (Like I want an /exit cmd to quit that interior , but I only want it to work when you are in the interior .

pawn Код:
CMD:interior1(playerid, params[])
{
     SendClientMessage(playerid,0xFFFF00AA,"Welcome to interior1");//mensaje que envia
    SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);//Cordenada del interior
    SetPlayerInterior(playerid, 17);//ID del interior
    SetPlayerVirtualWorld(playerid, 2);
    return 1;
}
3- I have a DM1 cmd, with the /leavedm and all that stuff. The problem is that when I do /dm1 and lets say im in "indm" state , I die and I spawn in the random spawn point outside the DM , and then have to type /leavedm and /dm1 to join it again.

Here it is:

pawn Код:
COMMAND:dm1(playerid, params[])
{
     new string[600],pname[MAX_PLAYER_NAME]; //More High string value more message words can be added. pname[MAX_PLAYER_NAME]; will gonna use by GetPlayerName
     GetPlayerName(playerid, pname, sizeof(pname)); //We will gonna use pname[MAX_PLAYER_NAME]; here.
     if(IsPlayerInDM[playerid] == 1) return SendClientMessage(playerid, 0xF0F8FFAA, "You are already in an deathmatch arena type /leavedm to leave in deathmatch arena"); //Check if player is in dm already if player is in dm the return SendClientMessage will be called
     IsPlayerInDM[playerid] = 1; //will set ISPlayerInDM[playerid] to 1
     format(string, sizeof(string), "%s has teleported to Drylake!", pname); //Format String will be used by SendClientMessageToAll. the pname that we define with GetPlayerName last time is used here if you have low string value in new string the message will be cutoff
     SendClientMessageToAll(0xF0F8FFAA, string); //Format string above will be sent if you have low string value in new string the message will be cutoff. otherwise this will sent your name saying you enter on MJ's Deathmatch Arena
     SendClientMessage(playerid, 0xAA3333AA, "You have teleported to Drylake DM"); //When you type the command this message will be sent
     SetPlayerPos(playerid,-55.2788,1523.2213,12.7500); //Example Only no have time to save pos its 10:30PM here
     SetPlayerFacingAngle(playerid,267.8478); //Example too replace this with your position coordinates.
     SetPlayerHealth(playerid, 100);
     SetPlayerArmour(playerid, 100);
     GivePlayerWeapon(playerid, 9, 500);
     GivePlayerWeapon(playerid, 24, 500);
     GivePlayerWeapon(playerid, 26, 500);
     GivePlayerWeapon(playerid, 28, 500);
     return 1;
}

CMD:leavedm(playerid, params[])
{
     new string[600],pname[MAX_PLAYER_NAME]; //More High string value more message words can be added. pname[MAX_PLAYER_NAME]; will gonna use by GetPlayerName
     GetPlayerName(playerid, pname, sizeof(pname)); //We will gonna use pname[MAX_PLAYER_NAME]; here.
     if(IsPlayerInDM[playerid] == 0) return SendClientMessage(playerid, 0xF0F8FFAA, "You have already left Drylake DM Arena!"); //Checks if player already left MJDM Arena if he is already the return sendclientmessage will be called
     IsPlayerInDM[playerid] = 0; //if the system detect that player are in DM yet the server will set and remove the player in DM
     format(string, sizeof(string), "%s has left Drylake DM!", pname); //Format String will be used by SendClientMessageToAll. the pname that we define with GetPlayerName last time is used here if you have low string value in new string the message will be cutoff
     SendClientMessageToAll(0xF0F8FFAA, string); //Format string above will be sent if you have low string value in new string the message will be cutoff. otherwise this will sent your name saying you left on MJ's Deathmatch Arena
     SendClientMessage(playerid, 0xAA3333AA, "You left Drylake DM"); //When you type the command this message will be sent
     SetPlayerPos(playerid,2592.9792,2791.0059,10.8203);
     SetPlayerFacingAngle(playerid,84.3642);//Your spawnpoint position code here!
     return 1;
}
4-In a killstreak system, how do I make one that changes your colour along with the number of kills you have? I cant find a tutorial anywhere for this. For example , kill 1 person : light yellow - , kill 2 people : orange ....

Thanks. And I will + rep you obviosly. You can answer any you want, those are mainly the 4 problems in my server
If you want to help me with it pm me
Reply
#2

1- What does stop working?

2-

pawn Код:
CMD:exitinterior(playerid, params[])
{
    if(GetPlayerInterior != 17) // if they are not in interior 17
        return SendClientMessage(playerid, -1, "You are not in interior1!");
    // else, if they are in interior 17
    SendClientMessage(playerid,0xFFFF00AA,"You are exiting interior1");//mensaje que envia
    SpawnPlayer(playerid); // spawns a player
    SetPlayerInterior(playerid, 0); // reset interior to 0
    SetPlayerVirtualWorld(playerid, 0); // reset virtual world to 0
    return 1;
}
3- That's strange because your dm1 command looks fine (Except the SetPlayerPos).

4-
pawn Код:
new Kills[MAX_PLAYERS]; // a per-player global variable to store a player's kills in

stock SetPlayerColorAccordingToKills(playerid)
{
    if(Kills[playerid] == 1)
    {
        // Player has 1 kill, set their color (Use SetPlayerColor)
    }
    else if(Kills[playerid] == 2)
    {
        // Player has 2 kills, set their color (Use SetPlayerColor)
    }
    // Continue
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerConnected(killerid)) // if killerid is a connected player
    {
        Kills[killerid] ++; // increase the variable for killerid (+1)
        // The usage of the stock we made
        SetPlayerColorAccordingToKills(killerid);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)