Jump to content

Povolání přes Klávesu


Vidie

Recommended Posts

hele a nasel jsem v tom bug ze kdyz ani nejsem v tom checkpointu a dam L.Alt tak me to zamestná nevíte jak ten bug opravit?

PAWN:

#include 
#pragma tabsize 0
new job[MAX_PLAYERS];
new superhrdina;
#define SCM SendClientMessage
#define COLOR_GREEN 0x00FF00AA
public OnFilterScriptInit()
{
superhrdina = CreatePickup(1314,1,-2317,-1636.1999511719,483.39999389648);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}


public OnGameModeInit()
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == superhrdina){
SCM(playerid,COLOR_GREEN,"Zaměstnej se jako Super Hrdina Alt");
}
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_WALK){
if(job[playerid] == 1) return SendClientMessage(playerid, COLOR_GREEN, "[** ERROR **] Zde už jsi zaměstnán!");
job[playerid] = 1;
SetPlayerSkin(playerid, 115);
GivePlayerWeapon(playerid, 26, 50);
}
return 1;
}

Link to comment
Share on other sites

Pro kubashek811: Zkus toto:

#include 
#pragma tabsize 0
new job[MAX_PLAYERS];
new superhrdina;
#define SCM SendClientMessage
#define COLOR_GREEN 0x00FF00AA

forward IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,radius);
forward GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z);

public IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,radius)
{
if(GetPlayerDistanceToPointEx(playerid,x,y,z) < radius) return 1;
return 0;
}
public GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z)
{
new Float:x1,Float:y1,Float:z12,Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z12);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)),2)
+floatpower(floatabs(floatsub(y,y1)),2)+floatpower(floatabs(floatsub(z,z12)),2));
return floatround(tmpdis);
}

public OnFilterScriptInit()
{
superhrdina = CreatePickup(1314,1,-2317,-1636.1999511719,483.39999389648);
  return 1;
}
public OnFilterScriptExit()
{
  return 1;
}


public OnGameModeInit()
{
  return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == superhrdina){
SCM(playerid,COLOR_GREEN,"Zaměstnej se jako Super Hrdina Alt");
}
  return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_WALK){
if(IsPlayerInSphere(playerid, -2317,-1636.1999511719,483.39999389648 ,5)==1) {
if(job[playerid] == 1) return SendClientMessage(playerid, COLOR_GREEN, "[** ERROR **] Zde už jsi zaměstnán!");
job[playerid] = 1;
SetPlayerSkin(playerid, 115);
GivePlayerWeapon(playerid, 26, 50);
}
}
  return 1;
}

Link to comment
Share on other sites

  • 1 year later...

Co jsem udělal špatně? :(

C:\Users\xxx\Desktop\2\samp\Mod pawno zalohy apod-\Mod pawno\MujMod.pwn(183) : warning 217: loose indentation
C:\Users\xxx\Desktop\2\samp\Mod pawno zalohy apod-\Mod pawno\MujMod.pwn(219) : error 017: undefined symbol "IsPlayerInSphere"
C:\Users\xxx\Desktop\2\samp\Mod pawno zalohy apod-\Mod pawno\MujMod.pwn(227) : warning 217: loose indentation
Pawn compiler 3.2.3664              Copyright © 1997-2006, ITB CompuPhase


1 Error.

 

Link to comment
Share on other sites

Poslala bys mi jak to má být správně?
Tady vidíš jak mam celý OnPlayerKeyStateChange

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_WALK){//L.ALT pro zaměstnání
    if(IsPlayerInSphere(playerid, 1218.6229, -1812.9830, 16.5938, 3) == 1){//když je v určitých souřadnicích, Doplnte si!
    if(job[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFAA, "[** ERROR **] Zde už jsi zaměstnán!");
    job[playerid] = 1; // Zaněstná ho
    SetPlayerSkin(playerid, 277);//nastavi skin
    GivePlayerWeapon(playerid, 9,1000);// damu zbran
    GivePlayerWeapon(playerid, 42,1000);// damu zbran
    GivePlayerWeapon(playerid, 46,1000);// damu zbran
    GivePlayerWeapon(playerid, 45,1000);// damu zbran
}
}

    return 1;
}

Link to comment
Share on other sites

  • Globální moderátor

ne, sežeň si stock ... je tu někde na webu nebo jinde na netu 

 

a to druhý - tabuj tímto:

 

img94joktmu71462.jpg?bev=778&nocache=134

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...