A case 0..5: az az 50%.És az alá ha sikerült mit tegyen a default alá ha nem sikerült.
new szam = random( 10 );
switch( szam )
{
case 0..5:
{
SendClientMessage(playerid,COLOR_RED,\"Sikeresen kiraboltad a bankot\");
GivePlayerMoney(playerid,5000000);
default:
{
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid,COLOR_RED,\"Nem sikerült el lopnod ezt a jármüvet kérlek probáld meg megin\");
SetPlayerWantedLevel(playerid,2);
}
}
CMD:do(playerid, params[])
{
new mesg[128],strin[128];
if(sscanf(params,\"s[128]\",mesg)) return SendClientMessage(playerid,COLOR_PURPLE,\"Használat: /do [esemény]\");
format(strin,sizeof(strin),\" %s: %s\",UnderscoreToSpaceName(playerid),mesg);
SendClientMessage(playerid,COLOR_PURPLE,strin);
return 1;
}
stock UnderscoreToSpaceName(playerid)
{
new Name0[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, Name0, sizeof(Name0));
}
else
{
Name0 = \"Disconnected/Nothing\";
}
for(new name0 = 0; name0 < MAX_PLAYER_NAME; name0++) if(Name0[name0] == \'_\') Name0[name0] = \' \';
return Name0;
}
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(!BigEar)
{
new VW = GetPlayerVirtualWorld(playerid);
new VW2 = GetPlayerVirtualWorld(i);
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//printf(\"DEBUG: X:%f Y:%f Z:%f\",posx,posy,posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
if(VW == VW2)
{
SendClientMessage(i, col1, string);
}
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
if(VW == VW2)
{
SendClientMessage(i, col2, string);
}
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
if(VW == VW2)
{
SendClientMessage(i, col3, string);
}
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
if(VW == VW2)
{
SendClientMessage(i, col4, string);
}
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
if(VW == VW2)
{
SendClientMessage(i, col5, string);
}
}
}
else
{
SendClientMessage(i, col1, string);
}
}
}
}
return 1;
}
new Float:RANDOMCP[][3] =
{
{-282.4485,2704.4287,62.2644},
{-253.4192,2722.9409,62.2631},
{-189.6879,2742.6396,62.2643},
{-195.7256,2677.7510,62.4127},
{-129.7518,2633.0691,63.6199},
{-422.9302,2723.0522,61.9725},
{-481.0598,2594.9138,52.3572},
{-660.6496,2745.0486,59.5627},
{-761.4356,2747.4077,45.5182},
{-1293.1514,2683.5798,49.7877},//
{-1450.2386,2607.1418,55.5611},
{-1498.2435,2578.1604,55.4127},
{-1524.5670,2555.0166,55.4127},
{-1543.4576,2609.8540,55.4110},//
{-1500.1841,2677.8411,55.5611},
{-1456.7468,2654.6477,55.5611}
};
És a CP megjelenitése
new rand = random(sizeof(RANDOMCP));
SetPlayerCheckpoint(playerid,RANDOMCP[rand][0],RANDOMCP[rand][1]RANDOMCP[rand][2],1);
De figyelj arra hogy nagy betüvel legyen a név
remélem érted de ne ctr+c ctr+v-zd csak
mert akkor nem érted mert nem teljes az egész ez csak egy részlet hogy értsd
[/code]