Off:Természetesen új témába és írd le ott teljesen hogy mi a hiba a sebzéssel hogy mikor szokott elõfordulni hogy nem sebez.Szerintem valami godos elágazásoddal van a probléma
Ez a szekció lehetővé teszi a felhasználó által írt összes hozzászólás megtekintését. Vedd figyelembe, hogy csak azokba a fórumokba írt hozzászólásokat látod, amelyekhez hozzáférésed van.
Üzenetek megjelenítése menü
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <dini>
#define COLOR_RED 0xff0000AA
new CPStatus[MAX_PLAYERS];
enum TaxiCars
{
taxi1,
taxi2
};
new Taxi[TaxiCars];
public OnFilterScriptInit()
{
Taxi[taxi1] = CreateVehicle(420,-209.7638,2608.5227,62.4824,359.4272,6,1,600000);
Taxi[taxi2] = CreateVehicle(420,-213.1385,2608.4824,62.4899,0.2146,6,1,600000);
return 0;
}
new szFile[ 40 + 1 ];
public OnPlayerConnect( playerid )
{
CPStatus[playerid] = 0;
format( szFile, sizeof( szFile ), \"Taxi/%s.ini\", szName( playerid ) );
if( dini_Exists( szFile ) )
{
SetPVarInt( playerid, \"Taxi\", dini_Int( szFile, \"Taxi\" ) );
}
else
{
SetPVarInt( playerid, \"Taxi\", 0 );
dini_Create( szFile );
}
return 1;
}
public OnPlayerDisconnect( playerid, reason )
{
format( szFile, sizeof( szFile ), \"Taxi/%s.ini\", szName(playerid));
dini_IntSet( szFile, \"Taxi\", GetPVarInt( playerid, \"Taxi\"));
return 1;
}
stock szName( playerid )
{
static s_szName[ MAX_PLAYER_NAME + 1 ];
GetPlayerName( playerid, s_szName, MAX_PLAYER_NAME );
return s_szName;
}
CMD:dolgozni(playerid,params[])
{
if( GetPVarInt( playerid, \"Taxi\" ) == 1)
{
new pName[MAX_PLAYER_NAME];
new string[250];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), \"%s taxi szolgálatba állt\", pName);
SendClientMessage(playerid,COLOR_RED, string);
}
else
{
SendClientMessage(playerid,COLOR_RED,\"Hogy akarsz taxi szolgálatba állni ha nem vagy taxis?\");
}
return 1;
}
CMD:taximunka(playerid,params[])
{
if( GetPVarInt( playerid, \"Taxi\" ) == 1) return SendClientMessage(playerid,COLOR_RED,\"Te már taxis vagy\");
SetPVarInt(playerid,\"Taxi\",1);
SendClientMessage(playerid,COLOR_RED,\"Te mostantól taxisként dolgozol kilépéshez felmond\");
return 1;
}
CMD:felmond(playerid,params[])
{
if( GetPVarInt( playerid, \"Taxi\" ) == 1)
{
SetPVarInt(playerid,\"Taxi\",0);
SendClientMessage(playerid,COLOR_RED,\"Mostmár nem dolgozol taxisként\");
}
else
{
SendClientMessage(playerid,COLOR_RED,\"Eddig sem voltál taxis\");
}
return 1;
}
CMD:taxihiv(playerid,params[])
{
if( GetPVarInt( playerid, \"Taxi\" ) == 1)
{
new pName[MAX_PLAYER_NAME];
new string[46];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), \"%s taxit hívott.\", pName);
SendClientMessageToAll(COLOR_RED, string);
SetPVarInt(playerid,\"Taxihív\",1);
}
return 1;
}
CMD:elfogadtaxi(playerid,params[])
{
if( GetPVarInt( playerid, \"Taxi\" ) == 1)
{
if( GetPVarInt( playerid, \"Taxihív\" ) == 1)
{
new Float:X1,Float:Y1,Float:Z1;
new giveplayerid;
if(sscanf(params, \"u\", giveplayerid)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /elfogadtaxi [Játékos]\");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Érvénytelen Játékos ID\");
GetPlayerPos(giveplayerid, X1, Y1, Z1);
SetPlayerCheckpoint(playerid, X1, Y1, Z1, 5);
CPStatus[playerid] = 1;
SetPVarInt(playerid,\"Taxihív\",0);
}
else
{
SendClientMessage(playerid,COLOR_RED,\"A játékos nem hívott taxit\");
}
}
else
{
SendClientMessage(playerid,COLOR_RED,\"Nem vagy taxis\");
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == Taxi[taxi1] || CarCheck == Taxi[taxi2])
{
if( GetPVarInt( playerid, \"Taxi\" ) == 1)
{
GameTextForPlayer(playerid, \"~g~Elkezdtel dolgozni!\", 3000, 3);
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,-1,\"Nem dolgozol taxisként\");
}
}
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
switch(CPStatus[playerid])
{
case 1:
{
SendClientMessage(playerid,COLOR_RED,\"Kimentél az utashoz ezért kaptál 2000Ft-t\");
DisablePlayerCheckpoint(playerid);
GivePlayerMoney(playerid,2000);
}
}
return 1;
}
if(GetPlayerTeam(playerid) == Rendor)
{
new giveplayerid;
if(sscanf(params,\"r\",giveplayerid) || !IsPlayerConnected(giveplayerid))
{return SendClientMessage(playerid,PIROS,\"Használat: /bilincs [játékos id / névrészlet]\");}
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
SendClientMessage(playerid,KEK,\"Játékos megbilincselve!\");
}
else
SendClientMessage(playerid,PIROS,\"Nem vagy rendõr te nem használhatsz bilincset\");
return 1;
}
CMD:elenged(playerid,params[])
{
if(GetPlayerTeam(playerid) == Rendor)
{
new giveplayerid;
if(sscanf(params,\"r\",giveplayerid) || !IsPlayerConnected(giveplayerid))
{ return SendClientMessage(playerid,PIROS,\"Használat: /elenged [játékos id / névrészlet]\"); }
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
SendClientMessage(playerid,KEK,\"Játékos Elengedve!\");
}
else
SendClientMessage(playerid,PIROS,\"Nem vagy rendõr te nem vehetedle a bilincset\");
return 1;
}
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/javít\", cmdtext, true, 10) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, \"Nem ülsz semmilyen jármûben!\");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, 0xFFFFFFFF, \"Jármûved megjavítva!\");
return 1;
}
return 0;
}
Idézetet írta: Pedró date=1352817785\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"29799\" data-ipsquote-contentclass=\"forums_TopicSorok végett megéri az új változatot használni..Igazad van :) majd ha fejlesztem akkor át rakom úgy és azt rakom fel :)
Sor takarékosság lehetne még: GetPlayerPos-t használni az if - else if ág-ak elõtt.. + a változók létrehozását is.
Dupla hozzászólás automatikusan összefûzve. ( 2012. november 13. - 15:54:25 )#include <a_samp>
#include <zcmd>
CMD:car(playerid, params[]) {
static Float: pX, Float: pY, Float: pZ, modelid;
GetPlayerPos( playerid, pX, pY, pZ );
if(!strcmp(params, \"landstalker\", true)) modelid = 400;
else if(!strcmp(params, \"bravura\", true)) modelid = 401;
// else if .. etc..
else SendClientMessage(playerid,COLOR_RED, \"Használata: /car kocsinév\");
CreateVehicle(modelid, pX + 0.0, pY + 0.0, pZ, 0.0, -1, -1, -1 );
SendClientMessage(playerid,COLOR_RED,\"Jármû le kreálva\");
return 1;
}
egy \"kicsit\" rövidebb megoldás lenne..
#include <a_samp>
#include <zcmd>
#include <colors>
CMD:afk(playerid,params[])
{
if( GetPVarInt( playerid, \"AFK\" ) == 1)
{
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid,COLOR_RED,\"[AFK]AFK mód bekapcsolva\");
SetPlayerVirtualWorld(playerid,1);
SetPVarInt(playerid,\"AFK\",0);
}
else
{
SendClientMessage(playerid,COLOR_RED,\"[AFK]Te már AFK vagy\");
}
return 1;
}
CMD:afkki(playerid,params[])
{
if( GetPVarInt( playerid, \"AFK\" ) == 0)
{
TogglePlayerControllable(playerid,1);
SendClientMessage(playerid,COLOR_RED,\"[AFK]AFK mód kikapcsolva\");
SetPlayerVirtualWorld(playerid,0);
SetPVarInt(playerid,\"AFK\",1);
}
else
{
SendClientMessage(playerid,COLOR_RED,\"[AFK]Te nem vagy AFK\");
}
return 1;
}
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid,\"AFK\",1);
return 1;
}
[code]
Az oldal 0.044 másodperc alatt készült el 20 lekéréssel.