if(PlayerToPoint(2,playerid,x,y,z))
{
//Do Something
}
if(strcmp(cmdtext, "/gethealth", true) == 0)
{
SetPlayerCheckpoint(playerid,x,y,z,4.0);
GameTextForPlayer(playerid, "~g~Get Health", 5000, 1);
if (TestDistance(playerid,giveplayerid,x,y.z,7))
SetPlayerHealth(playerid, 100.0);
return 1;
}
Originally Posted by Joeri
Put this on OnPlayerCommandText.
pawn Код:
I'm not good at scripting, i have no idea what to fill in with my cords where. |
public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, x, y, z); return 1; } public OnPlayerEnterCheckpoint(playerid) { SetPlayerHealth(playerid, 100.0); return 1; }
Originally Posted by steven_italy
Код:
public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, x, y, z); return 1; } public OnPlayerEnterCheckpoint(playerid) { SetPlayerHealth(playerid, 100.0); return 1; } |
public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, x, y, z); return 1; } public OnPlayerEnterCheckpoint(playerid) { SetPlayerHealth(playerid, 100.0); return 1; }
if(strcmp(cmdtext, "/gethealth", true) == 0) { SetPlayerCheckpoint(playerid,x,y,z,4.0); GameTextForPlayer(playerid, "~g~Get Health", 5000, 1); if (TestDistance(playerid,giveplayerid,x,y.z,7)) SetPlayerHealth(playerid, 100.0); return 1; }
Originally Posted by [SAP
Sidhu ]
Код:
public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, x, y, z); return 1; } public OnPlayerEnterCheckpoint(playerid) { SetPlayerHealth(playerid, 100.0); return 1; } Put the: Код:
if(strcmp(cmdtext, "/gethealth", true) == 0) { SetPlayerCheckpoint(playerid,x,y,z,4.0); GameTextForPlayer(playerid, "~g~Get Health", 5000, 1); if (TestDistance(playerid,giveplayerid,x,y.z,7)) SetPlayerHealth(playerid, 100.0); return 1; } |
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}
if(strcmp(cmdtext,"/heal",true ) == 0 )
{
if (PlayerToPoint(2, playerid, x, y, z)) // Replace X, Y, Z with the Co-Ords where you should be to do /heal
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR, " MESSAGE"); // Replace color with a color code, and replace message with any message you want
return 1;
}