Ahoj, dělám nový mód a potřebuji poradit s CreateVehicle. Mám tam stále 4 errory. Zde muj kod
if(strcmp("/auto", cmdtext, true) == 0)
new tmp[256];
new tmp2[256];
new tmp3[256];
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
tmp3 = strtok(cmdtext, idx);
new model = strval(tmp);
new color1 = strval(tmp2);
new color2 = strval(tmp3);
if(!strlen(tmp)){
SendClientMessage(playerid, COLOR_CERVENA, "Spatne zadane ID");
return 1;
}
if(!strlen(tmp2)){
SendClientMessage(playerid, COLOR_CERVENA, "Spatne zadane ID barvy 1");
return 1;
}
if(!strlen(tmp3)){
SendClientMessage(playerid, COLOR_CERVENA, "Spatne zadane ID barvy 2");
return 1;
}
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
CreateVehicle(model, x, y+2, z+1, a, color1, color2, -1);
new string[128];
format(string, sizeof(string), "Vytvoril jsi auto: %d .", model);
SendClientMessage(playerid, COLOR_CYAN, string);
return 1;
}
A errory -
C:\Users\Dan\Desktop\ptp.pwn(390) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Dan\Desktop\ptp.pwn(390) : error 017: undefined symbol "tmp"
C:\Users\Dan\Desktop\ptp.pwn(390) : warning 215: expression has no effect
C:\Users\Dan\Desktop\ptp.pwn(390) : error 001: expected token: ";", but found "]"
C:\Users\Dan\Desktop\ptp.pwn(390) : fatal error 107: too many error messages on one line
Dotaz
Pajda 0
Ahoj, dělám nový mód a potřebuji poradit s CreateVehicle. Mám tam stále 4 errory. Zde muj kod
A errory -
Díky pajda.
Link to comment
Share on other sites
4 odpovědí na tuto otázku
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now