callback help (public robbtimer) (bugging)
#5

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
Use this function instead of your GivePlayerNameEx

PHP код:

GetName
(playerid)
{
      new 
fdqkljqfdhqlsdhjf[MAX_PLAYER_NAME+1]; // I used a random name to be sure it won't get created twice in the script
      
GetPlayerName(playeridfdqkljqfdhqlsdhjfsizeof(fdqkljqfdhqlsdhjf));
      return 
fdqkljqfdhqlsdhjf;

then tell if it works or not.

EDIT : Show the timer which calls the function also please.
I guess, There is no problem at my GetPlayerNameEx Function, right??

Код:
stock GetPlayerNameEx(playerid)
{

	new
		sz_playerName[MAX_PLAYER_NAME],
		i_pos;

	GetPlayerName(playerid, sz_playerName, MAX_PLAYER_NAME);
	while ((i_pos = strfind(sz_playerName, "_", false, i_pos)) != -1) sz_playerName[i_pos] = ' ';
	return sz_playerName;
}
Код:
CMD:robbank(playerid, params[])
{
        if(robpossible == 1) //If the bank can be robbed we continue below
        {
                if(IsPlayerInRangeOfPoint(playerid, 2.0, 2319.2310,-2.0349,26.7496))
                {//Next thing we do is, we check if we are at the bank interior ^^
                
                    if(AdminDuty[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD1, "You cant rob bank while on duty ^^");
                    
                    if(PlayerInfo[playerid][pCrimes] == 3 && PlayerInfo[playerid][pWantedLevel] == 3) return SendClientMessage(playerid, COLOR_GRAD1, "You cannot /robbank when you have 3+ star! Be cool!");
                    robpossible = 0; //Then we set the bank so it cannot be robbed
                    SetTimer("waittimer", 900000, false); //Normal Mode 5 minutes
                    //SetTimer("waittimer", 65000, false); //Test Mode 65 seconds
                   
                    /* We also run another timer(1 minute) for the function that is
                    actually going to give us the money and a user friendly message.
                    */
                    /*
                    Add a function that would notify the police.
                    */

                    SendClientMessageToAll(COLOR_GREEN,"[BREAKING NEWS] Bank is being robbed, do not come near the bank!");
			        SendClientMessageToAll(0x0080FFFF, "Alerting all POLICE to come at bank As Soon as possible!!!");
			        SendClientMessageToAll(0x0080FFFF, "Lahat ng police PUMUNTA sa BANK ngayon din!!!");

                    SendClientMessage(playerid, 0xFF0000FF, "You are robbing the bank, the police has been notified!");
            		SendClientMessage(playerid, 0x008000FF, "You gotta stay 5 minutes before you get the moneys!!!");
            		
            		++PlayerInfo[playerid][pCrimes];
            		++PlayerInfo[playerid][pCrimes];
            		++PlayerInfo[playerid][pCrimes];
            		
					SetPlayerWantedLevel(playerid, ++PlayerInfo[playerid][pWantedLevel]);
					SetPlayerWantedLevel(playerid, ++PlayerInfo[playerid][pWantedLevel]);
					SetPlayerWantedLevel(playerid, ++PlayerInfo[playerid][pWantedLevel]);
					
					GameTextForPlayer(playerid, "~r~ALERT: BANK IS BEING ROB!", 3, 5000);
				 	SetTimer("robtimer", 300000, false);
				 	
				 	RobberBusted[playerid] = 0;
				 	pBankRobbing[playerid] = 1;
					

                 } else return SendClientMessage(playerid, COLOR_WHITE, "You are not in BANK SAFE!!");
        } else {
            SendClientMessage(playerid, COLOR_WHITE, "You can't rob the bank right now! Already rob or waiting for cool down");
        }
        return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)