Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IsPlayerOnWater(playerid)
- {
- new Float:x, Float:y, Float:z, Float:retx[2], Float:rety[2], Float:retz[2], Float: retdist[2], modelids[2];
- GetPlayerPos(playerid, x, y, z);
- new collisions = CA_RayCastMultiLine(x, y, z + 0.7, x, y, z - 0.7, retx, rety, retz, retdist, modelids, 2);
- //---
- if (collisions)
- {
- for(new i = 0; i < collisions; i++)
- {
- if (modelids[i] == 20000)
- {
- return true;
- }
- }
- }
- return false;
- }
- IsPlayerUnderWater(playerid)
- {
- new Float:x, Float:y, Float:z, Float:retx[10], Float:rety[10], Float:retz[10], Float: retdist[10], modelids[10];
- GetPlayerPos(playerid, x, y, z);
- new collisions = CA_RayCastMultiLine(x, y, z + 0.7, x, y, z + 1000.0, retx, rety, retz, retdist, modelids, 10);
- //---
- if (collisions)
- {
- for(new i = 0; i < collisions; i++)
- {
- if (modelids[i] == 20000)
- {
- return (true);
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement