02.02.2018, 11:28
still, server console closed itself.
I dont know which one is the function
I dont know which one is the function
PHP код:
forward Draggingt(dragg, playerid);
public Draggingt(dragg, playerid)
{
new Float:dX, Float:dY, Float:dZ;
GetPlayerPos(dragg, dX, dY, dZ);
SetPlayerPos(playerid, dX+1, dY, dZ);
}
CMD:drag(playerid, params[])
{
//line 32964 new ID, string[26+MAX_PLAYER_NAME], string2[20+MAX_PLAYER_NAME];
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_WHITE, "Pemakaian: /drag [playerid]");
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1, "Player not connected!");
if(ID == playerid) return SendClientMessage(playerid, COLOR_GRAD1, "You can't drag yourself!");
if(GetDistanceBetweenPlayers(playerid, ID) > 2)
{
SendClientMessage(playerid, COLOR_GRAD1, "You're too far away!" );
return 1;
}
SetPVarInt(ID, "DRAGG", playerid);
//line 32975 format(string2, sizeof(string2), "%s Telah menawari drag kepada anda, /acceptdrag untuk menerimanya", GetPlayerName(playerid));
SendClientMessage(ID, COLOR_GRAD1, string2);
SendClientMessage(playerid, COLOR_GRAD1, "Anda telah berhasil mengirim tawaran drag kepada player!");
return true;
}
// New drag
CMD:acceptdrag(playerid, params[])
{
new dragg = GetPVarInt(playerid, "DRAGG");
new string[128], string2[128];
if(dragg == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1, "The player that has invited you has left the server! Invite has been cancelled."), DeletePVar(playerid, "DRAGG");
if(GetDistanceBetweenPlayers(playerid, dragg) > 2)
{
SendClientMessage(playerid, COLOR_GRAD1, "You're too far away!");
return 1;
}
if(Dragged[playerid] < 0 && Dragging[dragg] < 0)
{
Dragged[playerid] = dragg;
Dragging[dragg] = playerid;
//line 32995 format(string, sizeof(string), "Kamu sedang didrag oleh %s.", GetPlayerName(dragg));
SCM(playerid, COLOR_PURPLE, string);
//line 32997 format(string2, sizeof(string2), "Anda telah mendrag %s, /undrag untuk berhenti", GetPlayerName(playerid));
SCM(dragg, COLOR_PURPLE, string2);
draggedtimer[playerid] = SetTimerEx("Draggingt", 1000, 1, "dd", dragg,playerid);
}
return true;
}