Need help with this -
Face9000 - 14.02.2012
Ok so,i've this timer when a player starts a robbery,it works good but i want change a thing.
I wanna keep the 30 seconds timer,but instead of the countdown gametext,i wanna replace it with the money robbed (that will increase every second for 30 seconds)
pawn Код:
public pRobTimer(playerid)
{
pRobCount[playerid]--;
IsRobbing[playerid] =1;
new rbgt[128];
format(rbgt, sizeof(rbgt), "Robbery ~g~in progress.~r~Do NOT leave the checkpoint.~y~Time left: ~g~%i", pRobCount[playerid]);
GameTextForPlayer(playerid, rbgt, 1000, 5);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new copmsg[170];
new cz;
cz = player_zone[playerid];
format(copmsg, sizeof(copmsg), "- WARNING ALL COPS: Robbery in progress by %s (%d) - Location: %s",name,playerid,zones[cz][zone_name]);
switch(pRobCount[playerid])
{
case 29:
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i))continue;
if(gTeam[i] == TEAM_COP)
{
SendClientMessage(i, COLOR_BLUE, copmsg);
}
}
}
case 0:
{
KillTimer(pRobTimerID[playerid]);
new plwl = GetPlayerWantedLevel(playerid);
plwl = GetPlayerWantedLevel(playerid);
SetPlayerWantedLevel(playerid,plwl +2);
new robmoney = 10500 + random(50000);
GivePlayerMoney(playerid,robmoney);
new string2[135];
format(string2, sizeof(string2), "- SUCCESS ROBBERY - Wanted Level %d - Robbed %i$",plwl,robmoney);
SendClientMessage(playerid,red,string2);
GameTextForPlayer(playerid, "Robbery ~r~COMPLETE.", 3000, 5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
IsRobbing[playerid] =0;
new string3[170];
new current_zone;
current_zone = player_zone[playerid];
GetPlayerName(playerid, name, sizeof(name));
format(string3, sizeof(string3), "- ROBBERY - %s (%d) has robbed %i$ from %s",name,playerid,robmoney,zones[current_zone][zone_name]);
SendClientMessageToAll(COLOR_WHITE,string3);
RobberyLog(string3);
}
}
return 1;
}
How i can?
Re: Need help with this -
Face9000 - 18.02.2012
Bump.
Re: Need help with this -
dice7 - 18.02.2012
Try this
pawn Код:
new robmoney[MAX_PLAYERS];
public pRobTimer(playerid)
{
robmoney[playerid] += random(50000);
pRobCount[playerid]--;
IsRobbing[playerid] =1;
new rbgt[128];
format(rbgt, sizeof(rbgt), "Robbery ~g~in progress.~r~Do NOT leave the checkpoint.~y~Money stolen: ~g~%i", robmoney[playerid]);
GameTextForPlayer(playerid, rbgt, 1000, 5);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new copmsg[170];
new cz;
cz = player_zone[playerid];
format(copmsg, sizeof(copmsg), "- WARNING ALL COPS: Robbery in progress by %s (%d) - Location: %s",name,playerid,zones[cz][zone_name]);
switch(pRobCount[playerid])
{
case 29:
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i))continue;
if(gTeam[i] == TEAM_COP)
{
SendClientMessage(i, COLOR_BLUE, copmsg);
}
}
}
case 0:
{
KillTimer(pRobTimerID[playerid]);
new plwl = GetPlayerWantedLevel(playerid);
plwl = GetPlayerWantedLevel(playerid);
SetPlayerWantedLevel(playerid,plwl +2);
GivePlayerMoney(playerid,robmoney[playerid]);
new string2[135];
format(string2, sizeof(string2), "- SUCCESS ROBBERY - Wanted Level %d - Robbed %i$",plwl,robmoney[playerid]);
SendClientMessage(playerid,red,string2);
GameTextForPlayer(playerid, "Robbery ~r~COMPLETE.", 3000, 5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
IsRobbing[playerid] =0;
new string3[170];
new current_zone;
current_zone = player_zone[playerid];
GetPlayerName(playerid, name, sizeof(name));
format(string3, sizeof(string3), "- ROBBERY - %s (%d) has robbed %i$ from %s",name,playerid,robmoney[playerid],zones[current_zone][zone_name]);
SendClientMessageToAll(COLOR_WHITE,string3);
RobberyLog(string3);
robmoney[playerid] = 0;
}
}
return 1;
}
Re: Need help with this -
aRoach - 18.02.2012
Or this:
pawn Код:
public pRobTimer( playerid )
{
new p_RobCash[ playerid ] + 1000 + random( 10000 );
pRobCount[ playerid ] --;
IsRobbing[ playerid ] =1;
new rbgt[ 128 ];
format( rbgt, 128, "Robbery ~g~in progress.~r~Do NOT leave the checkpoint.~y~Money: ~g~%i~n~~y~Time: ~r~%i", p_RobCash[ playerid ], pRobCount[ playerid ] );
GameTextForPlayer( playerid, rbgt, 1000, 5 );
new name[ MAX_PLAYER_NAME ];
GetPlayerName( playerid, name, MAX_PLAYER_NAME );
new copmsg[ 170 ];
new cz;
cz = player_zone[ playerid ];
format( copmsg, 170, "- WARNING ALL COPS: Robbery in progress by %s (%d) - Location: %s", name, playerid, zones[ cz ][ zone_name ] );
switch( pRobCount[ playerid ] )
{
case 29:
{
for( new slots = GetMaxPlayers( ), i; i < slots; i++ )
{
if( !IsPlayerConnected( i ) ) continue;
if( gTeam[ i ] == TEAM_COP )
{
SendClientMessage( i, COLOR_BLUE, copmsg );
}
}
}
case 0:
{
KillTimer( pRobTimerID[ playerid ] );
new plwl = GetPlayerWantedLevel( playerid );
plwl = GetPlayerWantedLevel( playerid );
SetPlayerWantedLevel( playerid, plwl + 2 );
GivePlayerMoney( playerid, p_RobCash[ playerid ] );
new string2[ 135 ];
format( string2, 135, "- SUCCESS ROBBERY - Wanted Level %d - Robbed %i$", plwl, p_RobCash[ playerid ] );
SendClientMessage( playerid, red, string2 );
GameTextForPlayer( playerid, "Robbery ~r~COMPLETE.", 3000, 5 );
SetPlayerScore( playerid, GetPlayerScore( playerid ) + 1 );
IsRobbing[ playerid ] =0;
new string3[ 170 ];
new current_zone;
current_zone = player_zone[ playerid ];
GetPlayerName( playerid, name, MAX_PLAYER_NAME );
format( string3, 170, "- ROBBERY - %s (%d) has robbed %i$ from %s", name, playerid, p_RobCash[ playerid ], zones[ current_zone ][ zone_name ] );
SendClientMessageToAll( COLOR_WHITE, string3 );
RobberyLog( string3 );
}
}
return 1;
}