Help with random spawn
#1

I have something like this


if (strcmp("//shermandm", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, -688.5651,2094.6106,925.0209);
GameTextForPlayer(playerid,"~y~Sherman DeathMatch~r~ by MosQ and Eset",3000,4);
SetPlayerArmour(playerid, 0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 999);

return 1;
}


But i want to make 2 spawns, not one, so it can be something like team deathmatch, can you help me please ?

... if you can please make me here 2 spawns (random), ill edit coordinates..

tnx
Reply
#2

thats not hard

pawn Код:
if (strcmp("/shermandm", cmdtext, true, 11) == 0)
{
    switch(random(2))
    {
        case 0: SetPlayerPos(playerid, -688.5651,2094.6106,925.0209);
        case 1: SetPlayerPos(playerid, -688.5651,2094.6106,925.0209);
    }
    GameTextForPlayer(playerid, "~y~Sherman DeathMatch~r~  by MosQ and Eset", 3000, 4);
    SetPlayerArmour(playerid, 0);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 24, 999);
    return 1;
}
Nothing more
Reply
#3

ok tnx.. just one more question,

how to add there SetPlayerColor

i want 2 random colors because its tdm
Reply
#4

Quote:
Originally Posted by Gotti_
Посмотреть сообщение
ok tnx.. just one more question,

how to add there SetPlayerColor

i want 2 random colors because its tdm
You just need brackets

pawn Код:
switch(random(2))
{
    case 0:
    {
        SetPlayerColor(playerid, 0xFFFFFFFF);
        SetPlayerPos(playerid, -688.5651,2094.6106,925.0209);
    }
    case 1:
    {
        SetPlayerColor(playerid, 0xFFFFFFFF);
        SetPlayerPos(playerid, -688.5651,2094.6106,925.0209);
    }
}
Reply
#5

thanks a lot !
Reply
#6

Actually you don't really need brackets

pawn Код:
if (strcmp("/shermandm", cmdtext, true, 11) == 0)
{
    switch(random(2))
    {
        case 0: SetPlayerPos(playerid, -688.5651,2094.6106,925.0209) && SetPlayerColor(playerid,blah);
        case 1: SetPlayerPos(playerid, -688.5651,2094.6106,925.0209) && SetPlayerColor(playerid,blah);
    }
    GameTextForPlayer(playerid, "~y~Sherman DeathMatch~r~  by MosQ and Eset", 3000, 4);
    SetPlayerArmour(playerid, 0);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 24, 999);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)