[QUESTION] Cuff Breaking
#1

Hello SA-MP. Im Currently Tryying To Script A /BreakCuffs Commands.

That When "if(cuffed[i] == 1"

Then The STRMP Is Typed "/Breakcuffs"

That cuffed[i] Is A Random Breakout Time, So He Might Be Lucky To Break Out. Any Help?

Or Someone Who Can Write Me A Little Script Would Be Excellent!
Reply
#2

do like:

if you want a timed one do like:

SetTimerEx("BreakCuffs",5000,false,"i",playerid);
Код:
public BreakCuffs(playerid)
{
new cuffbreak = random(5);
switch (cuffbreak)
{
case 0: Code of broke cuffs
case 1: return SendClientMessage or something you want..
case 2: return SendClientMessage or something you want..
case 3: return SendClientMessage or something you want..
case 4: return SendClientMessage or something you want..
}
}
Reply
#3

Thankyou For A Very Fast Reply 0ne, Im Just Wondering What You Mean By Here,

"case 0: Code of broke cuffs"
Reply
#4

Well you said you want a random breakout, so do a timer when he tries to make a /breakcuffs command of something like that

and on the randoms where id id

Switch(cuffbreak)
{
case 0: code of broke cuffs


if the random is == 0 do like cuffed[playerid] == 0, SendClientMessage(playerid,COLOR,"You have successfully broke the cuffs, run before the cop see's it.");

so:

pawn Код:
new cuffbreak = random(5);
switch (cuffbreak)
{
case 0: cuffed[playerid] == 0, SendClientMessage(playerid,COLOR,"You have successfully broke the cuffs, run before the cop see's it.");
case 1: return SendClientMessage or something you want..
case 2: return SendClientMessage or something you want..
case 3: return SendClientMessage or something you want..
case 4: return SendClientMessage or something you want..
}
}

Reply
#5

Hm...... Fixed Up Most Errors But.

Код:
public HandCuffed()
{
  for(new i = 0; i < MAX_PLAYERS; i++)
	{
   if(cuffed[i] == 1 && IsPlayerConnected(i))
	 {
    GameTextForPlayer(i,"Your Handcuffed",4000,3);
	 }
	 (Line : 4517)public BreakCuffs(i);
{
   new cuffbreak = random(5);
   (Line : 4520)switch (cuffbreak){;
{
cuffed[i] == 0, SendClientMessage(i,COLOR_GREEN,"You have successfully broke the cuffs, run before the cop see's it.");
}
}
My Errors
Код:
(4517) : error 029: invalid expression, assumed zero
(4517) : error 017: undefined symbol "BreakCuffs"
(4520) : error 002: only a single statement (or expression) can follow each "case"
Thankyou.

Reply
#6

Quote:
Originally Posted by Quicky1995
Hm...... Fixed Up Most Errors But.

Код:
public HandCuffed()
{
  for(new i = 0; i < MAX_PLAYERS; i++)
	{
   if(cuffed[i] == 1 && IsPlayerConnected(i))
	 {
    GameTextForPlayer(i,"Your Handcuffed",4000,3);
	 }
	 (Line : 4517)public BreakCuffs(i);
{
   new cuffbreak = random(5);
   (Line : 4520)switch (cuffbreak){;
{
cuffed[i] == 0, SendClientMessage(i,COLOR_GREEN,"You have successfully broke the cuffs, run before the cop see's it.");
}
}
My Errors
Код:
(4517) : error 029: invalid expression, assumed zero
(4517) : error 017: undefined symbol "BreakCuffs"
(4520) : error 002: only a single statement (or expression) can follow each "case"
Thankyou.

[pawn]
public HandCuffed()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(cuffed[i] == 1 && IsPlayerConnected(i))
{
GameTextForPlayer(i,"Your Handcuffed",4000,3);
}
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
forward BreakCuffs(i);
public BreakCuffs(i)
{
new cuffbreak = random(5);
switch (cuffbreak)

{
case 0:
case 1:
case 2:
case 3:
case 4:
}
cuffed[i] == 0 return SendClientMessage(i,COLOR_GREEN,"You have successfully broke the cuffs, run before the cop see's it.");
}
return 1;
}
Reply
#7

Did You Look, Re Look You May See (Line : ...)
Reply
#8

pawn Код:
public HandCuffed()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(cuffed[i] == 1 && IsPlayerConnected(i))
        {
            GameTextForPlayer(i,"Your Handcuffed",4000,3);
            cuffed[i] = 1;
        }
        SetTimer("BreakCuffs",5000,false,"i",playerid);
    }
}
forward BreakCuffs(playerid);
public BreakCuffs(playerid)
{
    new cuffbreak = random(5);
    switch (cuffbreak)
    {
        case 0: cuffed[playerid] == 0, SendClientMessage(playerid,COLOR_GREEN,"You have successfully broke the cuffs, run before the cop see's it."), TogglePlayerControllable(playerid,true);
        case 1: return SendClientMessage(playerid,COLOR_GREEN,"You failed to break cuffs.");
        case 2: return SendClientMessage(playerid,COLOR_GREEN,"You failed to break cuffs.");
        case 3: return SendClientMessage(playerid,COLOR_GREEN,"You failed to break cuffs.");
        case 4: return SendClientMessage(playerid,COLOR_GREEN,"You failed to break cuffs.");
    }
    return 1;
}
try now.
Reply
#9

Thankyou Alot Guys!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)