Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-04-21, 17:13


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

Witam.Mam problem z frakcja,kt?ra wyci??em z mapy.Jest masa error'?w,warning?w.Prosz? o pomoc w jej naprawie + prosi?bym o zmian? komend na zcmd.Za pomoc piwko i respekt. ;)


Kod:

#include <a_samp>
#include <dini>



#define TEAM_POMOC 1

#define POMOC "POMOC.ini"
new string[256];
new wpomoc[MAX_PLAYERS];
new gPlayerClass[MAX_PLAYERS];
new gTeam[MAX_PLAYERS];

public OnGameModeInit()
{


if(dini_Exists(POMOC)){
}else{
dini_Create(POMOC);
}

AddPlayerClass(50,1041.8950,1307.7068,10.9,270,0,0,0,0,0,0); // //POMOC 19

return 1;
}

SetPlayerClass(playerid, classid) {

if(classid == 0) {
DajDoPOMOC(playerid);
gTeam[playerid] = TEAM_POMOC;
}
}

public OnPlayerRequestSpawn(playerid)
{
if(gTeam[playerid] == TEAM_POMOC && wpomoc[playerid] == 1){
return 1;
}
else if(gTeam[playerid] == TEAM_POMOC && wpomoc[playerid] != 1){
return 0;
}

return 1;
}

public OnPlayerRequestClass(playerid, classid)
{


SetPlayerClass(playerid, classid);
SetupPlayerForClassSelection(playerid);
gPlayerClass[playerid] = classid;

switch (classid) {
case 0:
{

GameTextForPlayer(playerid, "~b~Pomoc Drogowa", 500, 6);

}



return 1;
}

public OnPlayerConnect(playerid)
{
wpomoc[playerid] = 0;

return 1;
}


public OnPlayerText(playerid, text[])
{

if(gTeam[playerid] == TEAM_POMOC)
{
format(str, sizeof str, "{996600}[Pomoc Drogowa]{FFFFFF}(ID:%d): %s", playerid, text);
}
return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
/////////////////////POMOC
if(strcmp(cmd, "/zatrudnij_pomoc", true) == 0){

new string2[256];
string = strtok(cmdtext, idx);
if(!strlen(string)) {
SendClientMessage(playerid, COLOR_YELLOW, "Wpisz: /dodaj_pomoc [nick]");
return 1;
}
new nick[256];
nick = string;
format(string2, sizeof(string2), "Gracz %s zostal dodany do Pomocy Drogowej!", string);
SendClientMessage(playerid, ZIELONY, string2);
string = strtok(cmdtext, idx);
dini_Set(POMOC, nick, "1");
return 1;
}


if(strcmp(cmd, "/usun_pomoc", true) == 0){
new string2[256];
string = strtok(cmdtext, idx);
if(!strlen(string)) {
SendClientMessage(playerid, COLOR_YELLOW, "Wpisz: /usun_pomoc [nick]");
return 1;
}
new nick[256];
nick = string;
format(string2, sizeof(string2), "Gracz %s zostal zwolniony z Pomocy Drogowej!", string);
SendClientMessage(playerid, ZIELONY, string2);
string = strtok(cmdtext, idx);
dini_Set(POMOC, nick, "0");
return 1;
}


if(strcmp(cmdtext, "/pd", true)==0){
new nazwa[256];
new str[256];
nazwa = Player(playerid);

format(str, 256, "*** %s wzywa Pomoc Drogow?!", PlayerName(playerid));
SendClientMessageToAll(0x77FF77FF, str);
return 1;
}
}
forward DajDoPOMOC(playerid);
public DajDoPOMOC(playerid)
{
if(strval(dini_Get(POMOC, Player(playerid))) == 1)
wpomoc[playerid] = 1;
return 1;
}


+ problem dotycz?cy warninga

Kod:

warning 202: number of arguments does not match definition


Linijka

Kod:

Update3DTextLabelText(Score[playerid], 0x00FF40FF, "Respekt: %d", GetPlayerScore(playerid));


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-22, 13:55


kuba12300







Wiek: 26
Na forum: 5193 dni
Posty: 4
Nick w MP: kuba12300

Piwa: 2

Respekt: 50

Liczba argument?w, kt?re poda?e?, nie odpowiada liczbie argument?w funkcji.

wiki.sa-mp.com/wiki/Update3DTextLabelText

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-22, 15:11


Wafelowski







Wiek: 29
Na forum: 5347 dni
Posty: 428

Piwa: 100

Respekt: 232
Respekt: 232Respekt: 232

Jak ju? to co? takiego:

Kod:


new tStr[30];
format(tStr, sizeof(tStr), "Respektu: %d", GetPlayerScore(playerid));
Update3DTextLabelText(Score[playerid], tStr, 0x00FF40FF);


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-23, 17:46


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

To pomo?e kto? przy tej frakcji ?

Co do tego drugiego problemu to

Kod:

error 035: argument type mismatch (argument 2)


Linijka:

Kod:

Update3DTextLabelText(Score[playerid], tStr, 0x00FF40FF);


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-23, 19:56


Seboo







Wiek: 30
Na forum: 5516 dni
Posty: 124
Nick w MP: Sebo

Piwa: 1228

Respekt: 102
Respekt: 102

Kod:

Update3DTextLabelText(Score[playerid], 0x00FF40F, tStr);


Postaw piwo autorowi tego posta
 

 
Tagi: frakcja
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku