02.01.2015, 17:53
Hello
guys i Want Know how to make in 1 commands all my new checkpoints robing with else
please help me and i want know when im adding the cp making it new cp_name;
its error why ?
this my code i want 1 making only else to know +rep
guys i Want Know how to make in 1 commands all my new checkpoints robing with else
please help me and i want know when im adding the cp making it new cp_name;
its error why ?
this my code i want 1 making only else to know +rep
PHP код:
#include <a_samp>
#include <Streamer>
#include <zcmd>
#define RED -1
#define ROB -1
#define INFO -1
forward robPizza( playerid ); //Add this to the top of your script under your includes!
//IDLEWOOD PIZZA
new
robTimerP[ MAX_PLAYERS ],
cp_Pizza,
bool: pRobbingP[ MAX_PLAYERS ],
bool: pizzaRobbed;
public OnGameModeInit()
{
cp_ammo = CreateDynamicCP(314.2581,-133.9305,999.6016, 3.0, .interiorid = -1);
cp_gym = CreateDynamicCP(766.4841,-60.3234,1000.6563, 3.0, .interiorid = -1);
cp_cluckin = CreateDynamicCP(2102.0273,2228.6897,11.0234, 3.0, .interiorid = -1);
cp_binco = CreateDynamicCP(207.7002,-100.3267,1005.2578, 3.0, .interiorid = -1);
cp_zip = CreateDynamicCP(161.5211,-83.2518,1001.8047, 3.0, .interiorid = -1);
cp_barber = CreateDynamicCP(418.3281,-78.8948,1001.8047, 3.0, .interiorid = -1);
cp_tatto = CreateDynamicCP(-201.9816,-25.0213,1002.2734, 3.0, .interiorid = -1);
cp_sexshop = CreateDynamicCP(-104.1407,-22.6708,1000.7188, 3.0, .interiorid = -1);
cp_seven = CreateDynamicCP(-23.4826,-55.6319,1003.5469, 3.0, .interiorid = -1);
cp_Pizza = CreateDynamicCP(376.0387,-117.2744,1001.4922, 3.0, .interiorid = -1);
return 1;
}
public OnPlayerEnterDynamicCP( playerid, checkpointid )
{
if( pRobbingP[ playerid ] )
{
if ( checkpointid == cp_seven )
if ( checkpointid == cp_ammo )
if ( checkpointid == cp_gym )
if ( checkpointid == cp_cluckin )
if ( checkpointid == cp_zip )
if ( checkpointid == cp_zip )
if ( checkpointid == cp_barber )
if ( checkpointid == cp_tatto )
if ( checkpointid == cp_sexshop )
if ( checkpointid == cp_Pizza )
{
pRobbingP[ playerid ] = false;
KillTimer( robTimerP[ playerid ] );
pizzaRobbed = false;
GameTextForPlayer( playerid, "~r~You have failed the robbery!", 1000, 3 );
}
}
return true;
}
CMD:robbery( playerid, params[ ] )
{
if ( pRobbingP[ playerid ] )
return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You are already robbing " );
if ( !IsPlayerInRangeOfPoint( playerid, 3.0, -23.4826,-55.6319,1003.5469 ) )
return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You must be in the checkpoint to use this command!" );
if ( pizzaRobbed )
return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Robing has been robbed recently, please wait patiently!" );
robTimerP[ playerid ] = SetTimerEx( "robPizza", 30000, false, "i", playerid );
SendClientMessage( playerid, INFO, "[ROBBERY INFO] You have started a robbery, it will last 30 seconds. Do not leave the checkpoint!" );
pRobbingP[ playerid ] = true;
pizzaRobbed = true;
new
szStr[ 128 ],
usrName[ 24 ];
GetPlayerName( playerid, usrName, 24 );
format( szStr, 128, "[ROBBERY] %s has began a robbery store", usrName );
SendClientMessageToAll( ROB, szStr );
GameTextForPlayer( playerid, "~g~Robbery in process~n~~r~Do not leave the checkpoint!", 30000, 3 );
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) +5);
return true;
}
public robPizza( playerid )
{
new
randMoney = random( 96000 );
GivePlayerMoney( playerid, randMoney );
new
szStr[ 128 ],
szStr1[128],
usrName[ 24 ];
GetPlayerName( playerid, usrName, 24 );
format( szStr, 128, "[ROBBERY] %s has robbed $%d from store", usrName, randMoney );
SendClientMessageToAll( ROB, szStr );
format( szStr, 128, "[ROBBERY INFO] Robbery succesfull! You have earned $%d and 1 score from the robbery.", randMoney );
SendClientMessage( playerid, INFO, szStr );
pRobbingP[ playerid ] = false;
SetTimer( "pizzaDelay", 90000, false );
format(szStr1, sizeof (szStr1), "~g~You have succesfuly robbed $%d from store", randMoney);
GameTextForPlayer( playerid, szStr1, 3000, 3 );
SetPlayerScore(playerid, GetPlayerScore(playerid) +1 );
}
forward pizzaDelay( );
public pizzaDelay( )
{
pizzaRobbed = false;
return true;
}