02.01.2009, 12:38
So, im trying out some stuff with my own server, and i need a command to spawn vehicles.
now someone gave me that, and i put it in pawno, but it gives some errors.
Could someone fix it for me please?
now someone gave me that, and i put it in pawno, but it gives some errors.
Could someone fix it for me please?
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new string[256]; new idx; new cmd[256]; new tmp[256]; new PlayerName[32]; new sendername[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new playername[MAX_PLAYER_NAME]; cmd = strtok(cmdtext, idx); if (strcmp(cmd, "/vec", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0x7D8778FF, "ERROR: No vehicle ID given."); return 1; } if (IsPlayerAdmin(playerid)) { new carid = strval(tmp); new Float:playerX,Float:playerY,Float:playerZ,Float:newX,Float:newY,Float:Angle; GetPlayerPos(playerid,playerX,playerY,playerZ); GetPlayerFacingAngle(playerid, Angle); newX = playerX + (5 * floatsin(-Angle, degrees)); newY = playerY + (5 * floatcos(-Angle, degrees)); CreateVehicle(carid, newX, newY, playerZ, Angle,-1,-1,10000); } return 1; } }