30.07.2010, 18:41
how can i make
like a command that when i put /nrg a nrg-500 spawns?
i havnt a clue
like a command that when i put /nrg a nrg-500 spawns?
i havnt a clue
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(nrg,3,cmdtext); // 3 because "nrg" has 3 letters
return 0;
}
dcmd_nrg(playerid,params[])
{
new Float:X, Float:Y, Float:Z;
#pragma unused params
GetPlayerPos(playerid,X,Y,Z);
AddStaticVehicle(/*NRG VEHICLE ID*/,X,Y,Z,0,0,0); // 1st 0 is for ROTATION, 2nd one and 3rd are for colors, this will be black
return 1;
}
C:\Users\james\Desktop\serverrrrr\gamemodes\Gamemo de.pwn(439) : error 017: undefined symbol "dcmd_nrg" C:\Users\james\Desktop\serverrrrr\gamemodes\Gamemo de.pwn(441) : error 017: undefined symbol "dcmd" C:\Users\james\Desktop\serverrrrr\gamemodes\Gamemo de.pwn(444) : error 017: undefined symbol "dcmd_nrg" C:\Users\james\Desktop\serverrrrr\gamemodes\Gamemo de.pwn(447) : error 017: undefined symbol "params" |
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) &&(dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
ok no thx iv made it my self and im not a newbie i just have some questions like you were borned already knowing everything right?
|
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/nrg", cmdtext, true, 10) == 0)
{
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new NRG = CreateVehicle(522, x, y, z,angle, 6, 0, 0);
PutPlayerInVehicle(playerid, NRG, 1);
return 1;
}
return 0;
}