Wysłany: 2012-01-02, 18:32
Alvi
Wiek: 29 Na forum: 5413 dni Posty: 5
Siema, mam taki problem. W sumie ostatnio ju? pisa?em ale na temat jak doko?czy? m?j kod dzi? pytam jak doda? wi?cej...
Ale m?wi?c pro?ciej chodzi mi o to jak doda? wi?cej os?b i wi?cej pojazd?w...
Kod: #include <a_samp>
#define COLOR_LIGHTRED 0xFF0000FF
new Alvi,
Uprawnienia[MAX_PLAYERS];
public OnFilterScriptInit()
{
Alvi = AddStaticVehicle(411,-470.1068,-513.2920,25.6342,87.6410,118,118); // ustaw wlasne pozycje
return 1;
}
public OnPlayerConnect(playerid)
{
Uprawnienia[playerid] = 0;
if(!strcmp(Player(playerid), "Alvi"))
{
Uprawnienia[playerid] = 1;
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new name[24];
GetPlayerName(playerid, name, 24);
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerVehicleID(playerid) == Alvi)
{
if(!strcmp(name, "Alvi"))
{
SendClientMessage(playerid,COLOR_LIGHTRED,"Wsiad?e? do swojego pojazdu!");
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_LIGHTRED,"Nie posiadasz kluczyk?w do tego pojazdu!");
}
}
}
return 1;
}
stock Player(playerid)
{
new player[MAX_PLAYERS];
GetPlayerName(playerid, player, sizeof(player));
return player;
}
Wysłany: 2012-01-02, 18:44
BraYaN_
Wiek: 34 Na forum: 6602 dni Posty: 276
Nick w MP: BraYaN_
Piwa : 1614
Alvi , dodajesz np. Pawn
p??niej
Pawn nickjakis = AddStaticVehicle ...
i
Pawn if( GetPlayerVehicleID ( playerid ) == nickjakis )
i jeszcze..
Pawn if(! strcmp ( name , "nickjakis" ))
r?b po prostu wed?ug tego, kt?ry ju? masz.
Wysłany: 2012-01-02, 18:53
Alvi
Wiek: 29 Na forum: 5413 dni Posty: 5
No i zle bo:
C:\Users\Szymon\Desktop\AUTA.pwn(10) : error 010: invalid function or declaration
C:\Users\Szymon\Desktop\AUTA.pwn(21) : error 017: undefined symbol "Uprawnienia"
C:\Users\Szymon\Desktop\AUTA.pwn(21) : warning 215: expression has no effect
C:\Users\Szymon\Desktop\AUTA.pwn(21) : error 001: expected token: ";", but found "]"
C:\Users\Szymon\Desktop\AUTA.pwn(21) : error 029: invalid expression, assumed zero
C:\Users\Szymon\Desktop\AUTA.pwn(21) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
Wysłany: 2012-01-02, 18:54
BraYaN_
Wiek: 34 Na forum: 6602 dni Posty: 276
Nick w MP: BraYaN_
Piwa : 1614
Alvi , poka? jak wygl?da teraz Tw?j kod.
Wysłany: 2012-01-02, 18:56
Alvi
Wiek: 29 Na forum: 5413 dni Posty: 5
Kod: #include <a_samp>
#define COLOR_LIGHTRED 0xFF0000FF
new Alvi;
new nickjakis
Uprawnienia[MAX_PLAYERS];
public OnFilterScriptInit()
{
Alvi = AddStaticVehicle(411,-470.1068,-513.2920,25.6342,87.6410,118,118); // ustaw wlasne pozycje
nickjakis = AddStaticVehicle(411,-470.1068,-513.2920,25.6342,87.6410,118,118); // ustaw wlasne pozycje
return 1;
}
public OnPlayerConnect(playerid)
{
Uprawnienia[playerid] = 0;
if(!strcmp(Player(playerid), "Alvi"));
if(GetPlayerVehicleID(playerid) == nickjakis)
{
Uprawnienia[playerid] = 1;
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new name[24];
GetPlayerName(playerid, name, 24);
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerVehicleID(playerid) == Alvi);
if(GetPlayerVehicleID(playerid) == nickjakis)
{
if(!strcmp(name, "Alvi"));
if(!strcmp(name, "nickjakis"))
{
SendClientMessage(playerid,COLOR_LIGHTRED,"Wsiad?e? do swojego pojazdu!");
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_LIGHTRED,"Nie posiadasz kluczyk?w do tego pojazdu!");
}
}
}
return 1;
}
stock Player(playerid)
{
new player[MAX_PLAYERS];
GetPlayerName(playerid, player, sizeof(player));
return player;
}
Wysłany: 2012-01-02, 19:02
BraYaN_
Wiek: 34 Na forum: 6602 dni Posty: 276
Nick w MP: BraYaN_
Piwa : 1614
Alvi , to by? przyk?ad tylko.
Pawn
#include <a_samp>
#define COLOR_LIGHTRED 0xFF0000FF
new Alvi ;
new nickjakis ;
public OnFilterScriptInit ()
{
Alvi = AddStaticVehicle ( 411 ,- 470.1068 ,- 513.2920 , 25.6342 , 87.6410 , 118 , 118 ); // ustaw wlasne pozycje
nickjakis = AddStaticVehicle ( 411 ,- 470.1068 ,- 513.2920 , 25.6342 , 87.6410 , 118 , 118 ); // ustaw wlasne pozycje
return 1 ;
}
public OnPlayerStateChange ( playerid , newstate , oldstate )
{
new name [ 24 ];
GetPlayerName ( playerid , name , 24 );
if( newstate == PLAYER_STATE_DRIVER )
{
if( GetPlayerVehicleID ( playerid ) == Alvi )
{
if(! strcmp ( name , "Alvi" ))
{
SendClientMessage ( playerid , COLOR_LIGHTRED , "Wsiad?e? do swojego pojazdu!" );
}
else
{
RemovePlayerFromVehicle ( playerid );
SendClientMessage ( playerid , COLOR_LIGHTRED , "Nie posiadasz kluczyk?w do tego pojazdu!" );
}
}
if( GetPlayerVehicleID ( playerid ) == nickjakis )
{
if(! strcmp ( name , "nickjakis" ))
{
SendClientMessage ( playerid , COLOR_LIGHTRED , "Wsiad?e? do swojego pojazdu!" );
}
else
{
RemovePlayerFromVehicle ( playerid );
SendClientMessage ( playerid , COLOR_LIGHTRED , "Nie posiadasz kluczyk?w do tego pojazdu!" );
}
}
}
return 1 ;
}
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: