What's wrong here?
#1

I made this code,put it in OnPlayerUpdate nut anyway half of the code isn't working:

pawn Код:
if(model == 541 && gTimeTravel[playerid] == 1 && GetPlayerSpeed(playerid) == 154)
   {
     SetPlayerPos(playerid,953.7294,-5127.9546,10.8525);
     if(IsPlayerInAnyVehicle(playerid)) return SetVehiclePos(vehicleid,953.7294,-5127.9546,10.8525) && SetVehicleHealth(vehicleid,0);
     SetPlayerWeather(playerid,16);
     new Float:x,Float:y,Float:z;
     SetPlayerPos(playerid,x,y,z+3);
     SendClientMessage(playerid,COLOR_RED,"2012.Aquring infos......");
     SendClientMessage(playerid,COLOR_RED,"System damage:99%,car destroyed,sending survival infos....");
     SendClientMessage(playerid,COLOR_RED,"System:Car detected on island,around.........");
     SendClientMessage(playerid,COLOR_RED,"SYSTEM STATE:CRITICAL,DAMAGE 100%,shutting down....");
     gTimeTravel[playerid] = 0;
  }
So the client messages can't be sent why?
Reply
#2

any1?
Reply
#3

Nothing happens when you do the code or whatever it is?
Reply
#4

Assuming that the GetPlayerSpeed is taking the speed of the vehicle - are you sure that you want to check if the speed is precisely 154, because the speed might get bigger, depending on the vehicle of course.

Also, you shouldn't use that OnPlayerUpdate. I suggest you to use timers, y_timers would be even better.
Reply
#5

Let me add on to what "HP" said:

When sending messages under "OnPlayerUpdate," they will be sent at least 3 times per second if the functions are performed- ultimately spamming the user in which the messages are being sent to. I doubt you want that happening.
Reply
#6

You could simply fool that by adding a variable and checking before sending the messages, but well yes - we don't want to get that messy, do we.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)