Help with this
#1

there something name


new breakcuffsrand = random(100);



can someone tell me what that mean please so i can control all rob command please

Код:
    new breakcuffsrand = random(100);
 	if(breakcuffsrand >=26 && breakcuffsrand <=100) // Failed
	{
	new escapedname[24];
	GetPlayerName(playerid,escapedname,24);
 	SendClientMessage(playerid,COLOR_ERROR,"Escape from rope is failed try again later! Escape failed.");
    return 1;
    }
    else
    if(breakcuffsrand >=0 && breakcuffsrand <=25) // complete
	{
	TogglePlayerControllable(playerid, 1);
	isKidnapped[playerid] =0;
	new escapedname[24];
	GetPlayerName(playerid,escapedname,24);
	GameTextForPlayer(playerid,"~r~ESCAPED~n~FROM ROPE",6000,3);
	format(string, sizeof(string), "%s(%d) Has escaped from rope",escapedname,playerid);
	printf("%s",string);
	for(new i=0;i<MAX_PLAYERS;i++)
	{
    if(HasKidnapped[i] == 1) {
    format(string, sizeof(string), "%s(%d) has escaped ",escapedname,playerid);
    SendClientMessage(i,COLOR_ROYALBLUE,string);
    HasKidnapped[i]=0;
Reply
#2

That variable contains of a value that is randomized from 0 - 100

pawn Код:
if(breakcuffsrand >=26 && breakcuffsrand <=100)
This means if the variable is between those numbers (or equal) It'll do what it said in the brackets, same with the other if statement.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)