24.08.2011, 20:50
Heey guys,
How can i make if a player is 3 seconds in a pickup there something happens?
Thanks admigo
How can i make if a player is 3 seconds in a pickup there something happens?
Thanks admigo
forward message();
public OnGameModeInit()
{
print("Starting timer...");
SetTimer("message", 3000, false); // Set a timer of 3000 miliseconds (3 seconds)
}
public message()
{
print("3 Seconds have passed, you must die.");
}
new ttttimer;
forward xd();
public OnGameModeInit(){
ttttimer = SetTimer("xd",ms to check,true);
}
public xd(){
for(new i=0,j=GetMaxPlayers();i<j;i++)
{
if(IsPlayerInRangeOfPoint(i, range, x, y, z))
{
// what i do?
}
}
}
public OnGameModeInit()
{
print("Starting timer...");
SetTimer("message", 3000, false); // Set a timer of 3000 miliseconds (3 seconds)
if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z))
{
SendClientMessage(playerid,0xFFFFFFFF,"Type Your Message Here.");
}
}
#include a_samp
forward pickuptimer();
public OnGameModeInit()
{
pickuptimer = SetTimer("pickuptimer", 3000, false);
return 1;
}
public pickuptimer()
{
if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z))
{
SetPlayerPos(playerid; x,y,z);
}
return 1;
}
new
Float:PC1[MAX_PLAYERS][3],
pickup;
public OnGameModeInit()
{
pickup = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1);
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pickup) {
GetPlayerPos(playerid, PC1[playerid][0], PC1[playerid][1], PC1[playerid][2]);
SetTimerEx("IsNearPickup", 3000, false, "i", playerid);
}
return 1;
}
forward IsNearPickup();
public IsNearPickup() {
if(IsPlayerInRangeOfPoint(playerid, 1.0, PC1[playerid][0], PC1[playerid][1], PC1[playerid][2])) {
GivePlayerCash(playerid, 50000);
SendClientMessage(playerid, -1, "You have been stood in pickup for three seconds.");
}
}