forward Tackle(playerid); forward waitfortackle(playerid); //--------------------TACKLE-------------------------// dcmd_tackle(playerid, params[]) { new id; if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /tackle [Playerid/Part of Playername]"); else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found"); else if(Vantispam[playerid] == 0) { if(GetDistanceBetweenPlayers(playerid, id) < 3) { if (!IsPlayerInAnyVehicle(id)) { if(ResultChance(40))//40 procent kans dat het fout gaat { new string[48]; new strings[48]; new tacklename[MAX_PLAYERS]; new tackledname[MAX_PLAYERS]; GetPlayerName(playerid, tacklename, sizeof(tacklename)); format(string, sizeof(string), "You have been tackled by %s!",tacklename); TogglePlayerControllable(id, false); SendClientMessage(id,0xAA3333AA,string); GetPlayerName(id, tackledname, sizeof(tackledname)); format(strings, sizeof(strings), "You have tackled %s!",tackledname); SendClientMessage(playerid,0xAA3333AA,strings); SetTimerEx("Tackle", 3000, false, "u", id); ApplyAnimation(id,"CRACK","crckdeth2",4.0,0,0,0,1,1); Vantispam[playerid] = 1; SetTimerEx("waitfortackle", 60000, false, "i", playerid); }else{ SendClientMessage(id,0xAA3333AA,"It failed!"); } }else{ SendClientMessage(id,0xAA3333AA,"You need to wait before tackle again!"); } } } if(GetDistanceBetweenPlayers(playerid, id) > 3) { SendClientMessage(playerid,0xAA3333AA,"Player is to far away!"); } if(IsPlayerInAnyVehicle(id)) { SendClientMessage(playerid,0xAA3333AA,"You can't tackle somebody when he's in a car!"); } return 1; } public Tackle(playerid) { TogglePlayerControllable(playerid, true); ClearAnimations(playerid); return 1; } public waitfortackle(playerid) { Vantispam[playerid] = 0; return 1; }
new Float:Velocity[3];
GetPlayerVelocity(playerid, Velocity[0], Velocity[1], Velocity[2]);
if(Velocity[0] == 0 && Velocity[1] == 0 && Velocity[2] == 0) return SendClientMessage(playerid, 0xFF000000, "You need to move to use that command");
Originally Posted by Dark_Kostas
You can use this, but im not sure if it will work as i had problems with GetPlayerVelocity.
pawn Код:
|
C:\Samp0.3Server.win32\gamemodes\Tacke.pwn(262) : error 029: invalid expression, assumed zero C:\Samp0.3Server.win32\gamemodes\Tacke.pwn(262) : warning 215: expression has no effect C:\Samp0.3Server.win32\gamemodes\Tacke.pwn(262) : error 001: expected token: ";", but found "if" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.