[Help] Object/item ectra spawn on player spawn?
#1

How would i make it so that a object would spawn when the player spawns if its possible?

I imagined it somthing like this but thats incorrect;

Code:
public OnPlayerSpawn(playerid)
{
Createobi (0,0,0,0,0,0);
return 1;
}
Quote:

createobi allready defined in the script

so yh is there any way to make an object spawn when a player spawns?
Reply
#2

Your excess of spelling errors and grammar mistakes lead me to believe you don't understand programming completely... or much at all.

All functions have to be spelled correctly and are case-sensitive.

pawn Code:
new pObject[playerid];
public OnPlayerSpawn(playerid)
{
  if(IsValidObject(pObject[playerid]))DestroyObject(pObject[playerid]); //If the object already exists, delete it.
  pObject[playerid]=CreateObject(1385,0,0,0,0,0,0);
  return 1;
}
Reply
#3

Firstly:
wow some small spelling and grammar mistakes but easily understood if you used your brain.
I also know code is case sensitive and to be spelt correctly, if you actually look at the code there is no mistakes just "Createobi" in which you did not know what it was.

Secondly:
I should have explained a bit more,

My "Createobi" is several objects placed together to create something, not saying what at the moment but i need the group of objects to spawn when a player spawns but not on the player infact else were on the map also i do not need destroy object if to many or already exists as i have my own function already built into my script that does that for when i was testing it.
Reply
#4

Need some help Please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)